internal.gpu

Standard library module View source
variable CUDA_SUCCESS
CUDA_SUCCESS: Literal[int] = 0
variable CUDA_ERROR_NOT_FOUND
CUDA_ERROR_NOT_FOUND: Literal[int] = 500
variable CUresult
CUresult = i32
variable CUdevice
CUdevice = i32
variable CUdeviceptr
CUdeviceptr = u64
variable CUmodule
CUmodule = cobj
variable CUcontext
CUcontext = cobj
variable CUfunction
CUfunction = cobj
variable modules
modules: List[CUmodule] = []
variable cuCtxCreate
cuCtxCreate = Function[([Ptr[cobj], u32, CUdevice], CUresult)](cobj())
variable cuMemAlloc
cuMemAlloc = Function[([Ptr[CUdeviceptr], i64], CUresult)](cobj())
variable cuMemcpyDtoH
cuMemcpyDtoH = Function[([cobj, CUdeviceptr, u64], CUresult)](cobj())
variable cuMemcpyHtoD
cuMemcpyHtoD = Function[([CUdeviceptr, cobj, u64], CUresult)](cobj())
variable cuMemFree
cuMemFree = Function[([CUdeviceptr], CUresult)](cobj())
variable cuDeviceComputeCapability
cuDeviceComputeCapability = Function[([Ptr[i32], Ptr[i32], CUdevice], CUresult)](cobj())
variable cuDeviceGet
cuDeviceGet = Function[([Ptr[CUdevice], i32], CUresult)](cobj())
variable cuDeviceGetCount
cuDeviceGetCount = Function[([Ptr[i32]], CUresult)](cobj())
variable cuDeviceGetName
cuDeviceGetName = Function[([Ptr[u8], i32, CUdevice], CUresult)](cobj())
variable cuGetErrorName
cuGetErrorName = Function[([CUresult, Ptr[cobj]], CUresult)](cobj())
variable cuGetErrorString
cuGetErrorString = Function[([CUresult, Ptr[cobj]], CUresult)](cobj())
variable cuInit
cuInit = Function[([u32], CUresult)](cobj())
variable cuLaunchKernel
cuLaunchKernel = Function[([CUfunction, u32, u32, u32, u32, u32, u32, u32, cobj, cobj, cobj], CUresult)](cobj())
variable cuModuleGetFunction
cuModuleGetFunction = Function[([Ptr[CUfunction], CUmodule, cobj], CUresult)](cobj())
variable cuModuleLoadData
cuModuleLoadData = Function[([Ptr[CUmodule], cobj], CUresult)](cobj())
class Device
@tuple
class Device
Constructors 1
__new__
__new__(idx: int)
Properties 1
compute_capability
@property
compute_capability(self)
Methods 1
count
@staticmethod
count()
Special methods 3
__str__
__str__(self)
__index__
__index__(self)
__bool__
__bool__(self)
function cuda_init_handles
cuda_init_handles(cuda_handle: cobj)
function cuda_check
cuda_check(err)
function nvptx_init
nvptx_init()
function nvptx_load_module
nvptx_load_module()
function cuda_init
cuda_init(debug: bool = False)
class Memory
@tuple
class Memory[T]
Fields 1
T type
Constructors 1
__new__
__new__(ptr: cobj)
Properties 1
ptr
@property
ptr(self)
Methods 1
to_ptr
@pure @llvm
to_ptr(p: CUdeviceptr)
%0 = inttoptr i64 %p to ptr
ret ptr %0
function syncthreads
@llvm
syncthreads()
declare void @llvm.nvvm.barrier0()
call void @llvm.nvvm.barrier0()
ret {} {}
class Dim3
@tuple
class Dim3
Constructors 1
__new__
__new__(x: int, y: int, z: int)
Properties 3
x
@property
x(self)
y
@property
y(self)
z
@property
z(self)
class Block
@tuple
class Block
Properties 4
x
@property
x(self)
y
@property
y(self)
z
@property
z(self)
dim
@property
dim(self)
variable thread
thread = Thread()
variable block
block = Block()
variable grid
grid = Grid()
variable warp
warp = Warp()
function nvptx_function
nvptx_function(name: Literal[str])
function canonical_dim
canonical_dim(dim)
function offsets
offsets(t)
function kernel_wrapper
kernel_wrapper(*args, grid, block, fn)
function kernel
kernel(fn)
class Pointer
@tuple
class Pointer[T]
Fields 1
T type
Special methods 3
__to_gpu__
__to_gpu__(self, cache: AllocCache)
__from_gpu__
__from_gpu__(self, other: Ptr[T])
__from_gpu_new__
__from_gpu_new__(other: Ptr[T])
function raw
raw(v)
class Ptr
@extend
class Ptr[T]
Special methods 3
__to_gpu__
__to_gpu__(self, cache: AllocCache)
__from_gpu__
__from_gpu__(self, other: Ptr[T])
__from_gpu_new__
__from_gpu_new__(other: Ptr[T])
class NoneType
@extend
class NoneType
Special methods 3
__to_gpu__
__to_gpu__(self, cache: AllocCache)
__from_gpu__
__from_gpu__(self, other: NoneType)
__from_gpu_new__
__from_gpu_new__(other: NoneType)
class float
@extend
class float
Special methods 3
__to_gpu__
__to_gpu__(self, cache: AllocCache)
__from_gpu__
__from_gpu__(self, other: float)
__from_gpu_new__
__from_gpu_new__(other: float)
class float32
@extend
class float32
Special methods 3
__to_gpu__
__to_gpu__(self, cache: AllocCache)
__from_gpu__
__from_gpu__(self, other: float32)
__from_gpu_new__
__from_gpu_new__(other: float32)
class float16
@extend
class float16
Special methods 3
__to_gpu__
__to_gpu__(self, cache: AllocCache)
__from_gpu__
__from_gpu__(self, other: float16)
__from_gpu_new__
__from_gpu_new__(other: float16)
class bfloat16
@extend
class bfloat16
Special methods 3
__to_gpu__
__to_gpu__(self, cache: AllocCache)
__from_gpu__
__from_gpu__(self, other: bfloat16)
__from_gpu_new__
__from_gpu_new__(other: bfloat16)
class bool
@extend
class bool
Special methods 3
__to_gpu__
__to_gpu__(self, cache: AllocCache)
__from_gpu__
__from_gpu__(self, other: bool)
__from_gpu_new__
__from_gpu_new__(other: bool)
class Int
@extend
class Int[N]
Special methods 3
__to_gpu__
__to_gpu__(self, cache: AllocCache)
__from_gpu__
__from_gpu__(self, other: Int[N])
__from_gpu_new__
__from_gpu_new__(other: Int[N])
class UInt
@extend
class UInt[N]
Special methods 3
__to_gpu__
__to_gpu__(self, cache: AllocCache)
__from_gpu__
__from_gpu__(self, other: UInt[N])
__from_gpu_new__
__from_gpu_new__(other: UInt[N])
class str
@extend
class str
Special methods 3
__to_gpu__
__to_gpu__(self, cache: AllocCache)
__from_gpu__
__from_gpu__(self, other: str)
__from_gpu_new__
__from_gpu_new__(other: str)
class bytes
@extend
class bytes
Special methods 3
__to_gpu__
__to_gpu__(self, cache: AllocCache)
__from_gpu__
__from_gpu__(self, other: bytes)
__from_gpu_new__
__from_gpu_new__(other: bytes)
class List
@extend
class List[T]
Special methods 3
__to_gpu__
@inline
__to_gpu__(self, cache: AllocCache)
__from_gpu__
@inline
__from_gpu__(self, other: List[T])
__from_gpu_new__
@inline
__from_gpu_new__(other: List[T])
class DynamicTuple
@extend
class DynamicTuple[T]
Special methods 3
__to_gpu__
@inline
__to_gpu__(self, cache: AllocCache)
__from_gpu__
@inline
__from_gpu__(self, other: DynamicTuple[T])
__from_gpu_new__
@inline
__from_gpu_new__(other: DynamicTuple[T])
class OrderedDict
@extend
class OrderedDict[K, V]
Special methods 3
__to_gpu__
__to_gpu__(self, cache: AllocCache)
__from_gpu__
__from_gpu__(self, other: OrderedDict[K, V])
__from_gpu_new__
__from_gpu_new__(other: OrderedDict[K, V])
class Set
@extend
class Set[K]
Special methods 3
__to_gpu__
__to_gpu__(self, cache: AllocCache)
__from_gpu__
__from_gpu__(self, other: Set[K])
__from_gpu_new__
__from_gpu_new__(other: Set[K])
class Optional
@extend
class Optional[T]
Special methods 3
__to_gpu__
__to_gpu__(self, cache: AllocCache)
__from_gpu__
__from_gpu__(self, other: Optional[T])
__from_gpu_new__
__from_gpu_new__(other: Optional[T])