numba_vulkan.stubs#

Functions that only have a meaning inside a kernel.

Attributes#

Functions#

global_id(axis)

Index of the current invocation along axis of the dispatch grid.

local_id(axis)

Index of the current invocation within its workgroup along axis.

group_id(axis)

Index of the current workgroup along axis, like cuda.blockIdx.

local_size(axis)

Number of invocations per workgroup along axis, like cuda.blockDim.

num_groups(axis)

Number of workgroups along axis of the dispatch, like cuda.gridDim.

barrier()

Wait until every invocation of the workgroup has reached this point.

Module Contents#

numba_vulkan.stubs.global_id(axis)#

Index of the current invocation along axis of the dispatch grid.

Parameters:

axis (int) – Constant 0, 1 or 2.

Returns:

Like cuda.grid, this can exceed the requested extent because the grid is rounded up to whole workgroups, so kernels must bounds-check.

Return type:

int

numba_vulkan.stubs.local_id(axis)#

Index of the current invocation within its workgroup along axis.

Like cuda.threadIdx.

Parameters:

axis (int) – Constant 0, 1 or 2.

Return type:

int

numba_vulkan.stubs.group_id(axis)#

Index of the current workgroup along axis, like cuda.blockIdx.

Parameters:

axis (int) – Constant 0, 1 or 2.

Return type:

int

numba_vulkan.stubs.local_size(axis)#

Number of invocations per workgroup along axis, like cuda.blockDim.

Parameters:

axis (int) – Constant 0, 1 or 2.

Return type:

int

numba_vulkan.stubs.num_groups(axis)#

Number of workgroups along axis of the dispatch, like cuda.gridDim.

Parameters:

axis (int) – Constant 0, 1 or 2.

Return type:

int

numba_vulkan.stubs.barrier()#

Wait until every invocation of the workgroup has reached this point.

Like cuda.syncthreads: writes to shared and global memory made before the barrier are visible to the whole workgroup after it. All invocations of a workgroup must reach the same barrier, so it must not be called under a condition that differs between them.

numba_vulkan.stubs.syncthreads#
numba_vulkan.stubs.shared#
numba_vulkan.stubs.atomic#
numba_vulkan.stubs.local#
numba_vulkan.stubs.subgroup#