Skip to main content

Documentation 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.

TornadoVM is a GPU programming framework for Java that transparently JIT-compiles Java bytecode into NVIDIA CUDA PTX, OpenCL C, and Apple Metal (MSL) at runtime. Your existing Java code runs on NVIDIA GPUs, AMD GPUs, Intel GPUs, Apple Silicon, FPGAs, and multi-core CPUs — with no CUDA C, no JNI bindings, and no native toolchain in your application. It works with standard JDK 21 and JDK 25.

Introduction

Understand TornadoVM’s architecture, programming model, and supported hardware.

Installation

Install TornadoVM via SDKMAN!, from source, or with Maven/Gradle.

Quickstart

Write and run your first GPU-accelerated Java program in minutes.

API Reference

Full reference for TaskGraph, TornadoExecutionPlan, KernelContext, and more.

The Programming Model

TornadoVM offers two complementary styles that can be mixed in the same TaskGraph:

Annotation API

Add @Parallel to loop variables and @Reduce for reductions — TornadoVM infers the thread mapping automatically.

Kernel API

Use KernelContext for explicit global/local thread IDs, local memory, and barriers — the same model as CUDA and OpenCL.

TaskGraph & Execution Plan

Chain tasks, control data transfers, and run on any device with TaskGraph and TornadoExecutionPlan.

Off-Heap Data Types

Use FloatArray, IntArray, HalfFloatArray, and more for zero-copy device memory management.

NVIDIA Ecosystem Integration

On NVIDIA hardware, TornadoVM goes beyond code generation — it integrates the entire CUDA software stack directly into the TaskGraph.

Hybrid API

Mix JIT-compiled Java kernels with cuBLAS, cuFFT, cuDNN, and CUTLASS library calls in one graph.

cuBLAS

SGEMM, SGEMV, FP16 Tensor Core GemmEx, and fused epilogues from pure Java.

cuFFT

1D and 2D complex/real FFT transforms with automatic plan caching.

CUDA Graphs

Capture entire pipelines into CUDA Graphs for single-launch replay.

Supported Backends

CUDA Backend

Java → Graal IR → CUDA PTX → NVRTC → cubin. Full NVIDIA library ecosystem access.

OpenCL Backend

Targets NVIDIA, AMD, Intel GPUs, integrated GPUs, multi-core CPUs, and FPGAs.

Apple Metal Backend

Native Metal Shading Language (MSL) generation for Apple Silicon M1–M4.

Multi-Device

Distribute tasks across multiple devices and migrate them dynamically at runtime.

Get Started in 3 Steps

1

Install TornadoVM

Install via SDKMAN! — choose the backend matching your hardware:
sdk install tornadovm 5.2.0-cuda    # NVIDIA GPUs
sdk install tornadovm 5.2.0-opencl  # AMD/Intel/NVIDIA via OpenCL
sdk install tornadovm 5.2.0-metal   # Apple Silicon
2

Verify your devices

tornado --devices
3

Run your first accelerated program

java @$TORNADOVM_HOME/tornado-argfile \
  -cp $TORNADOVM_HOME/share/java/tornado/tornado-examples-5.2.0.jar \
  uk.ac.manchester.tornado.examples.compute.MatrixVectorRowMajor
See the Quickstart guide for a full walkthrough of writing your own kernel.

Add TornadoVM to Your Project

pom.xml
<dependencies>
  <dependency>
    <groupId>io.github.beehive-lab</groupId>
    <artifactId>tornado-api</artifactId>
    <version>5.2.0-jdk21</version>
  </dependency>
  <dependency>
    <groupId>io.github.beehive-lab</groupId>
    <artifactId>tornado-runtime</artifactId>
    <version>5.2.0-jdk21</version>
  </dependency>
</dependencies>
The Tornado-API module is licensed under Apache 2.0. The runtime and drivers use GPLv2 with Classpath Exception — the same license as OpenJDK — which does not impose copyleft obligations on your application.

Build docs developers (and LLMs) love