Skip to content

module gpu

Source: stdlib/gpu.codon


Device @tuple Class is named tuple (cannot write fields)

Properties

compute_capability @property Method is a class property

Magic methods

__new__(device: int)

__str__(self)

__index__(self)

__bool__(self)

Methods

count() @staticmethod Method is static (does not take 'self' argument)


Memory[T] @tuple Class is named tuple (cannot write fields)

Fields

T: type


syncthreads() @llvm Function is implemented with inline LLVM IR

declare void @llvm.nvvm.barrier0()
call void @llvm.nvvm.barrier0()
ret {} {}

Dim3 @tuple Class is named tuple (cannot write fields)

Properties

x @property Method is a class property

y @property Method is a class property

z @property Method is a class property

Magic methods

__new__(x: int, y: int, z: int)


Thread @tuple Class is named tuple (cannot write fields)

Properties

x @property Method is a class property

y @property Method is a class property

z @property Method is a class property


Block @tuple Class is named tuple (cannot write fields)

Properties

x @property Method is a class property

y @property Method is a class property

z @property Method is a class property

dim @property Method is a class property


Grid @tuple Class is named tuple (cannot write fields)

Properties

dim @property Method is a class property


Warp @tuple Class is named tuple (cannot write fields)

Magic methods

__len__(self)


thread = Thread()


block = Block()


grid = Grid()


warp = Warp()


AllocCache @tuple Class is named tuple (cannot write fields)

Fields

v: List[Ptr[byte]]

Methods

add(self, p: Ptr[byte])

free(self)


kernel(fn)


Pointer[T] @tuple Class is named tuple (cannot write fields)

Fields

T: type

Magic methods

__to_gpu__(self, cache: AllocCache)

__from_gpu__(self, other: Ptr[T])

__from_gpu_new__(other: Ptr[T])


raw(v)


Ptr[T] @extend Class is extended to add given methods

Magic methods

__to_gpu__(self, cache: AllocCache)

__from_gpu__(self, other: Ptr[T])

__from_gpu_new__(other: Ptr[T])


NoneType @extend Class is extended to add given methods

Magic methods

__to_gpu__(self, cache: AllocCache)

__from_gpu__(self, other: NoneType)

__from_gpu_new__(other: NoneType)


int @extend Class is extended to add given methods

Magic methods

__to_gpu__(self, cache: AllocCache)

__from_gpu__(self, other: int)

__from_gpu_new__(other: int)


float @extend Class is extended to add given methods

Magic methods

__to_gpu__(self, cache: AllocCache)

__from_gpu__(self, other: float)

__from_gpu_new__(other: float)


float32 @extend Class is extended to add given methods

Magic methods

__to_gpu__(self, cache: AllocCache)

__from_gpu__(self, other: float32)

__from_gpu_new__(other: float32)


bool @extend Class is extended to add given methods

Magic methods

__to_gpu__(self, cache: AllocCache)

__from_gpu__(self, other: bool)

__from_gpu_new__(other: bool)


byte @extend Class is extended to add given methods

Magic methods

__to_gpu__(self, cache: AllocCache)

__from_gpu__(self, other: byte)

__from_gpu_new__(other: byte)


Int[N] @extend Class is extended to add given methods

Magic methods

__to_gpu__(self, cache: AllocCache)

__from_gpu__(self, other: Int[N])

__from_gpu_new__(other: Int[N])


UInt[N] @extend Class is extended to add given methods

Magic methods

__to_gpu__(self, cache: AllocCache)

__from_gpu__(self, other: UInt[N])

__from_gpu_new__(other: UInt[N])


str @extend Class is extended to add given methods

Magic methods

__to_gpu__(self, cache: AllocCache)

__from_gpu__(self, other: str)

__from_gpu_new__(other: str)


List[T] @extend Class is extended to add given methods

Magic methods

__to_gpu__(self, cache: AllocCache) @inline Function always inlined

__from_gpu__(self, other: List[T]) @inline Function always inlined

__from_gpu_new__(other: List[T]) @inline Function always inlined


DynamicTuple[T] @extend Class is extended to add given methods

Magic methods

__to_gpu__(self, cache: AllocCache) @inline Function always inlined

__from_gpu__(self, other: DynamicTuple[T]) @inline Function always inlined

__from_gpu_new__(other: DynamicTuple[T]) @inline Function always inlined


Dict[K,V] @extend Class is extended to add given methods

Magic methods

__to_gpu__(self, cache: AllocCache)

__from_gpu__(self, other: Dict[K, V])

__from_gpu_new__(other: Dict[K, V])


Set[K] @extend Class is extended to add given methods

Magic methods

__to_gpu__(self, cache: AllocCache)

__from_gpu__(self, other: Set[K])

__from_gpu_new__(other: Set[K])


Optional[T] @extend Class is extended to add given methods

Magic methods

__to_gpu__(self, cache: AllocCache)

__from_gpu__(self, other: Optional[T])

__from_gpu_new__(other: Optional[T])