PY-NUMB0004 · dynamic_kernel_array_shape
Count local or shared arrays whose shape comes from a kernel parameter.
This is a deterministic rule for python. Read its implementation.
Definition
Section titled “Definition”Report cuda.local.array and cuda.shared.array calls whose shape argument is a parameter of
the surrounding Numba CUDA kernel. These arrays require a simple compile-time constant shape.
A launch-time parameter cannot satisfy that contract.
Evidence
Section titled “Evidence”Each finding identifies the allocation call, kernel, and dynamic shape parameter. The value is the number of kernel arrays with parameter-dependent shapes.
Exceptions
Section titled “Exceptions”Literal shapes and names bound to module constants are accepted. Dynamic shared memory passed
through the launch configuration is a different mechanism and does not call shared.array
with a parameter shape.
Examples
Section titled “Examples”@cuda.jitdef reduce(values, width): tile = cuda.shared.array(width, float32)TILE_WIDTH = 256
@cuda.jitdef reduce(values): tile = cuda.shared.array(TILE_WIDTH, float32)References
Section titled “References”- Cites “Numba CUDA documentation”, memory management and local memory. Open reference
- Cites “Numba CUDA documentation”, CUDA Kernel API and memory management. Open reference