/usr/local/lib64/python3.6/site-packages/torch/include/THC
NameSizeModeActions
generic/-0755rm
THC.h3280644editdlrm
THCAllocator.h3700644editdlrm
THCAsmUtils.cuh34440644editdlrm
THCAtomics.cuh130940644editdlrm
THCCachingHostAllocator.h12540644editdlrm
THCDeviceTensor-inl.cuh115150644editdlrm
THCDeviceTensor.cuh161600644editdlrm
THCDeviceTensorUtils-inl.cuh44970644editdlrm
THCDeviceTensorUtils.cuh27200644editdlrm
THCDeviceUtils.cuh9420644editdlrm
THCGeneral.h27410644editdlrm
THCGeneral.hpp7430644editdlrm
THCGenerateAllTypes.h9580644editdlrm
THCGenerateBFloat16Type.h5150644editdlrm
THCGenerateBoolType.h4490644editdlrm
THCGenerateByteType.h4190644editdlrm
THCGenerateCharType.h4180644editdlrm
THCGenerateComplexDoubleType.h5330644editdlrm
THCGenerateComplexFloatType.h5260644editdlrm
THCGenerateComplexTypes.h2980644editdlrm
THCGenerateDoubleType.h4640644editdlrm
THCGenerateFloatType.h5500644editdlrm
THCGenerateFloatTypes.h7790644editdlrm
THCGenerateHalfType.h4810644editdlrm
THCGenerateIntType.h4140644editdlrm
THCGenerateLongType.h4190644editdlrm
THCGenerateShortType.h4240644editdlrm
THCIntegerDivider.cuh40950644editdlrm
THCNumerics.cuh198130644editdlrm
THCScanUtils.cuh47890644editdlrm
THCSleep.h2320644editdlrm
THCStorage.h4870644editdlrm
THCStorage.hpp8460644editdlrm
THCStorageCopy.h4660644editdlrm
THCTensor.h6230644editdlrm
THCTensor.hpp10700644editdlrm
THCTensorCopy.h4670644editdlrm
THCTensorCopy.hpp6000644editdlrm
THCTensorMathReduce.cuh6640644editdlrm
THCThrustAllocator.cuh6180644editdlrm
Edit: /usr/local/lib64/python3.6/site-packages/torch/include/THC/THCAsmUtils.cuh (3444B)
#ifndef THC_ASM_UTILS_INC #define THC_ASM_UTILS_INC // Collection of direct PTX functions template struct Bitfield {}; template <> struct Bitfield { static __device__ __forceinline__ unsigned int getBitfield(unsigned int val, int pos, int len) { #if defined(__HIP_PLATFORM_HCC__) pos &= 0xff; len &= 0xff; unsigned int m = (1u << len) - 1u; return (val >> pos) & m; #else unsigned int ret; asm("bfe.u32 %0, %1, %2, %3;" : "=r"(ret) : "r"(val), "r"(pos), "r"(len)); return ret; #endif } static __device__ __forceinline__ unsigned int setBitfield(unsigned int val, unsigned int toInsert, int pos, int len) { #if defined(__HIP_PLATFORM_HCC__) pos &= 0xff; len &= 0xff; unsigned int m = (1u << len) - 1u; toInsert &= m; toInsert <<= pos; m <<= pos; return (val & ~m) | toInsert; #else unsigned int ret; asm("bfi.b32 %0, %1, %2, %3, %4;" : "=r"(ret) : "r"(toInsert), "r"(val), "r"(pos), "r"(len)); return ret; #endif } }; template <> struct Bitfield { static __device__ __forceinline__ uint64_t getBitfield(uint64_t val, int pos, int len) { #if defined(__HIP_PLATFORM_HCC__) pos &= 0xff; len &= 0xff; uint64_t m = (1u << len) - 1u; return (val >> pos) & m; #else uint64_t ret; asm("bfe.u64 %0, %1, %2, %3;" : "=l"(ret) : "l"(val), "r"(pos), "r"(len)); return ret; #endif } static __device__ __forceinline__ uint64_t setBitfield(uint64_t val, uint64_t toInsert, int pos, int len) { #if defined(__HIP_PLATFORM_HCC__) pos &= 0xff; len &= 0xff; uint64_t m = (1u << len) - 1u; toInsert &= m; toInsert <<= pos; m <<= pos; return (val & ~m) | toInsert; #else uint64_t ret; asm("bfi.b64 %0, %1, %2, %3, %4;" : "=l"(ret) : "l"(toInsert), "l"(val), "r"(pos), "r"(len)); return ret; #endif } }; __device__ __forceinline__ int getLaneId() { #if defined(__HIP_PLATFORM_HCC__) return __lane_id(); #else int laneId; asm("mov.s32 %0, %%laneid;" : "=r"(laneId) ); return laneId; #endif } #if defined(__HIP_PLATFORM_HCC__) __device__ __forceinline__ unsigned long long int getLaneMaskLt() { const std::uint64_t m = (1ull << getLaneId()) - 1ull; return m; } #else __device__ __forceinline__ unsigned getLaneMaskLt() { unsigned mask; asm("mov.u32 %0, %%lanemask_lt;" : "=r"(mask)); return mask; } #endif #if defined (__HIP_PLATFORM_HCC__) __device__ __forceinline__ unsigned long long int getLaneMaskLe() { std::uint64_t m = UINT64_MAX >> (sizeof(std::uint64_t) * CHAR_BIT - (getLaneId() + 1)); return m; } #else __device__ __forceinline__ unsigned getLaneMaskLe() { unsigned mask; asm("mov.u32 %0, %%lanemask_le;" : "=r"(mask)); return mask; } #endif #if defined(__HIP_PLATFORM_HCC__) __device__ __forceinline__ unsigned long long int getLaneMaskGt() { const std::uint64_t m = getLaneMaskLe(); return m ? ~m : m; } #else __device__ __forceinline__ unsigned getLaneMaskGt() { unsigned mask; asm("mov.u32 %0, %%lanemask_gt;" : "=r"(mask)); return mask; } #endif #if defined(__HIP_PLATFORM_HCC__) __device__ __forceinline__ unsigned long long int getLaneMaskGe() { const std::uint64_t m = getLaneMaskLt(); return ~m; } #else __device__ __forceinline__ unsigned getLaneMaskGe() { unsigned mask; asm("mov.u32 %0, %%lanemask_ge;" : "=r"(mask)); return mask; } #endif #endif // THC_ASM_UTILS_INC