TornadoVM abstracts every compute accelerator—NVIDIA GPUs, AMD GPUs, Intel iGPUs, FPGA devices, and the JVM itself—behind a singleDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/Deepak-Sangle/TornadoVM/llms.txt
Use this file to discover all available pages before exploring further.
TornadoDevice interface. At startup the runtime discovers all available backends and enumerates their devices into an ordered list, sorted by compute capability and available memory. You interact with devices through a three-layer hierarchy: the TornadoRuntimeProvider singleton exposes the top-level TornadoRuntime; each TornadoRuntime holds one or more TornadoBackend objects (one per compiled backend); and each TornadoBackend exposes one or more TornadoDevice objects. Most applications need only the default device, but scientific workloads running on nodes with multiple GPUs will use the enumeration API to select a specific card by index, backend type, or memory capacity.
TornadoRuntimeProvider — the entry point
Package: uk.ac.manchester.tornado.api.runtime
TornadoRuntimeProvider is a static utility class. It is initialized on first access via a ServiceLoader that loads the concrete runtime implementation.
Returns the singleton
TornadoRuntime. This is the primary entry point for all device enumeration and selection.Returns
true when TornadoVM profiling is active (-Dtornado.profiler=true).Returns
true when NVIDIA NVML power monitoring is enabled.Sets a TornadoVM runtime property programmatically (equivalent to a
-D JVM flag).TornadoRuntime interface
Package: uk.ac.manchester.tornado.api
Returns the number of installed and available backends (e.g. 2 if both OpenCL and CUDA are compiled in and find hardware).
Returns the backend at the given index. Indices are stable within a process and match the order in which backends were loaded.
Returns the backend of the given class type; useful for retrieving a CUDA-specific backend instance without knowing its index.
Returns the
TornadoVMBackendType enum value for the backend at index, without retrieving the full backend object.Returns the integer index of the backend whose class matches the argument, or −1 if not found.
Returns the highest-priority device across all backends. Priority is based on compute capability and memory; on a system with one CUDA GPU and one integrated OpenCL GPU, this will return the CUDA device.
Changes which backend index is considered primary, affecting
getDefaultDevice().Returns
true when the TornadoVM profiler is active.TornadoBackend interface
Package: uk.ac.manchester.tornado.api
One TornadoBackend instance exists per loaded backend (OpenCL, CUDA, SPIR-V, Metal, Java). It enumerates the devices available through that backend.
Total number of accelerator devices visible to this backend (e.g. 2 for a dual-GPU node using the CUDA backend).
Returns the
TornadoDevice at the given index within this backend.Returns an unmodifiable list of all devices in this backend.
Returns the first (highest-priority) device within this backend.
Promotes the device at
index to the head of this backend’s internal device list, making it the default for this backend.Returns a human-readable backend name (e.g.
"OpenCL", "CUDADriver", "Metal").Returns the
TornadoVMBackendType enum value for this backend.Returns the number of underlying platform instances (relevant for OpenCL, which may expose multiple platform drivers).
Returns the hardware category (
CPU, GPU, ACCELERATOR, CUSTOM) of the default device in this backend.TornadoDevice interface
Package: uk.ac.manchester.tornado.api.common
TornadoDevice is the principal handle for a single compute accelerator. Pass it to TornadoExecutionPlan.withDevice(TornadoDevice) to pin execution to a specific card.
Identification
Human-readable device name as reported by the driver (e.g.
"NVIDIA GeForce RTX 4090", "AMD Radeon RX 7900 XTX").Extended device description including driver and platform information.
Name of the underlying platform (e.g. the OpenCL platform or the CUDA toolkit version string).
Returns the
TornadoVMBackendType enum value for this device. Use this to branch on CUDA vs OpenCL at runtime.Returns the hardware category:
GPU, CPU, ACCELERATOR, CUSTOM, etc.Returns the index of the backend that owns this device (matches
TornadoRuntime.getBackend(int)).Memory
Maximum number of bytes that can be allocated in a single buffer on this device.
Total global (device) memory in bytes.
Size of local (shared) memory per compute unit in bytes.
Compute
Maximum work-group (thread block) dimensions as a
long[3] array: [maxX, maxY, maxZ].The OpenCL C language version supported by the device. Returns a backend-specific string for non-OpenCL devices.
Returns the number of processors available to the JVM. For physical GPU devices this delegates to
Runtime.getRuntime().availableProcessors(); virtual devices override it to return the value from the descriptor file.TornadoVMBackendType enum
Package: uk.ac.manchester.tornado.api.enums
| Value | Description |
|---|---|
OPENCL | OpenCL C backend — supports AMD, Intel, NVIDIA, and CPU OpenCL platforms. |
CUDA | NVIDIA PTX / CUDA backend — required for library tasks (cuBLAS, cuDNN, etc.). |
METAL | Apple Metal backend — macOS/iOS GPU acceleration via MSL. |
JAVA | JVM fallback — runs code on the CPU without any GPU dispatch. |
VIRTUAL | Virtual device — reads configuration from a descriptor file; used in testing and CI. |
Enumerating all devices
The following example walks every backend and every device, printing their names, types, and memory budgets.Selecting a device for an execution plan
Pass aTornadoDevice to TornadoExecutionPlan.withDevice(TornadoDevice) to override the default selection.
- By backend + index
- By device index
- Default device
- Largest GPU by memory
Backend type quick-reference
OPENCL
Broadest hardware compatibility. Supports AMD, Intel, NVIDIA, and multi-core CPU targets via a single compilation path.
CUDA
Required for library tasks (cuBLAS, cuDNN, cuFFT, cuSPARSE, CUTLASS). Compiles Java kernels to PTX. Best raw throughput on NVIDIA hardware.
METAL
Apple GPU acceleration on macOS and iOS via Metal Shading Language. Requires an Apple Silicon or recent Intel Mac with a Metal-capable GPU.
JAVA
JVM fallback that runs TornadoVM kernels as plain Java on the CPU. Useful for debugging correctness before deploying to a GPU.