Docs / nablatensor-engine-cuda / com.nablatensor.backend.cuda

final class

CudaJit

Public, minimal handle on the CUDA driver for code that generates its own kernel source at runtime (NVRTC compile, device allocate, launch). The tensor/jit path in CudaBackend keeps its own fused-kernel cache; this facade exists so other modules can drive the same driver context and stream without a second CUDA context being created.

Methods

static boolean isAvailable()
static String deviceName()
static String architecture()

NVRTC target architecture of device 0, e.g. compute_75.

static boolean kernelTimeoutEnabled()

Whether the driver will kill kernels that run too long on this device (CU_DEVICE_ATTRIBUTE_KERNEL_EXEC_TIMEOUT). This is set precisely when the device is also driving a display, in which case an overlong launch does not merely fail: it stalls the compositor for the duration and, once the watchdog fires, takes the screen down with it through a GPU reset. Callers should bound their launch durations when this is true.

static long compile(String source, String kernelName)

Compiles CUDA C source with NVRTC and returns a launchable function handle.

static long malloc(long bytes)
static void free(long pointer)
static void uploadDoubles(long pointer, double[] data)
static void uploadInts(long pointer, int[] data)

Uploads a tape's structural arrays (opcodes, argument indices, flags).

static double[] downloadDoubles(long pointer, int count)
static void launch(long function, int grid, int block, Object... arguments)

Launches a 1-D grid. Arguments must be Long, Integer or Float.

static void synchronize()