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

final class

VulkanCompute

Public, tensor-free entry point to the headless Vulkan compute runtime.

VulkanRuntime is package-private and its only public face is VulkanBackend, which is bound to the nablatensor-core tensor SPI. A caller that wants to register and dispatch its own compute shaders — nablatensor-vulkan's replay kernel being the motivating case — has no need of tensors, so this class re-exports just the raw primitives: shader registration, buffer allocation, host copies, and a one-dimensional dispatch that blocks on vkQueueWaitIdle.

Methods

static boolean isAvailable()

Whether a Vulkan compute device could be brought up on this machine.

static String deviceName()

Name of the physical device the runtime selected.

static void registerPipeline(String name, String glsl, int bindings)

Compiles glsl (a compute shader) to SPIR-V and builds a pipeline for it, bound to bindings std430 storage buffers at bindings 0 .. bindings-1 plus a 128-byte compute push-constant block. A no-op if name is already registered, so the caller keys distinct tapes by distinct names.

static long[] alloc(long bytes)

[buffer, memory] handles for a device buffer of bytes.

static void free(long buffer, long memory)
static void writeFloats(long memory, float[] data)
static float[] readFloats(long memory, int count)
static void dispatch(String kernel, int groupsX, long[] buffers, int[] pushInts)

Records and submits one dispatch of groupsX workgroups over buffers (bound 0..n-1), with pushInts written into the push-constant block, and blocks until it retires.

static void sync()