Docs / jax4j-engine-rocm / com.nablatensor.jax4j.backend.rocm

final class

HipCompute

Public facade over the package-private HipRuntime, for code outside this module that needs a raw ROCm/HIP compute surface: HIPRTC compilation, device allocation, host<->device double transfers and a 1-D kernel launch.

The AAD ROCm replay engine (com.nablatensor.jax4j.engine.rocm) is the intended caller; it mirrors com.nablatensor.jax4j.backend.vulkan.VulkanCompute.

Methods

static boolean isAvailable()

Whether a usable HIP device is present. Never throws.

static String deviceName()

Device name for diagnostics, or a placeholder if the context is unavailable.

static String arch()

The --offload-arch target HIPRTC will build for (e.g. gfx1103).

static long compile(String source, String kernelName)

Compiles HIP/CUDA-C source with HIPRTC and returns a launchable function handle for kernelName. Callers should cache the handle by source; this does not.

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

Host-to-device copy into an already-allocated pointer.

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

Launches a 1-D grid of grid blocks of block threads. Arguments are Long (device pointers / 64-bit scalars), Integer or Float, matched positionally to the kernel.

static void synchronize()