Docs / nablatensor-tensor / com.nablatensor.tensor.spi

final class

GpuLaunch

Launch-geometry arithmetic shared by the CUDA, ROCm, and Vulkan compute backends: how many blocks / workgroups cover a flat element count. Kept in one place so the formula (and the block size the flat one-dimensional kernels are written for) has a single definition.

Fields

static final int DEFAULT_BLOCK

Threads per block / workgroup the flat one-dimensional kernels are written for.

Methods

static int grid1d(int elements)

Blocks needed to cover elements at DEFAULT_BLOCK threads each.

static int grid1d(int elements, int block)

Blocks needed to cover elements at block threads each; 0 -> 0.

static int ceilDiv(int size, int divisor)

ceil(size / divisor) for a positive divisor.