TornadoVM Flags
TornadoVM provides runtime and compiler flags to enable experimental features, tuning, and profiling. These flags fall into two categories:
JVM Flags (passed with the -D prefix via the –jvm option)
TornadoVM CLI Flags (passed directly to the tornado Python wrapper)
Note
In the examples below, s0 refers to a task graph and t0 to a specific task within that graph.
Example Usage
$ tornado --jvm "-Dtornado.fullDebug=true" -m tornado.examples/uk.ac.manchester.examples.compute.Montecarlo 1024
Debugging and Logging
CLI Flags
Flag |
Description |
|---|---|
|
Enables full debug mode (maps to |
|
Enables basic debug output such as compilation status and device info. |
|
Prints generated OpenCL/CUDA kernels. |
|
Displays the number of threads used. |
|
Lists available hardware devices. |
JVM Flags
Flag |
Description |
|---|---|
|
Enables full debug output including bytecode and runtime internals. |
|
Prints generated OpenCL/CUDA kernels. |
|
Saves generated kernels to the specified file. |
|
Named NVRTC option bundle for the CUDA backend: |
|
Displays the number of threads used. |
|
Prints TornadoVM Internal Bytecodes to stdout. |
|
Dumps TornadoVM Internal Bytecodes to the specified file. |
Profiling
CLI Flags
Flag |
Description |
|---|---|
|
Prints profiling metrics as JSON to stdout. |
|
Collects profiling metrics internally (see TornadoVM Profiler API). |
|
Saves profiling output to the specified file. |
JVM Flags
Flag |
Description |
|---|---|
|
Enables profiling and prints metrics as JSON to sdout. |
|
Collects profiling metrics internally for logging. |
|
Saves profiling output to the specified file. |
Performance & Scheduling
JVM Flags
Flag |
Description |
|---|---|
|
Uses nanoseconds for timing instead of milliseconds (default: true). |
|
Sets custom global workgroup size. |
|
Sets custom local workgroup size. |
|
Enables concurrent execution across devices (default: false). |
|
Sets the default backend/device index used when none is explicitly selected (default: 0 for both). |
|
Sets backend priority; higher wins when multiple backends can run a task (default: OpenCL=10, CUDA=0, Metal=0). |
|
Disables reusing device buffers across executions of the same task-graph (default: true). |
|
Disables freeing device resources when the execution plan closes (default: true). |
|
Partitions the iteration space into blocks (one per visible CPU core when running on CPUs) (default: false). |
Optimizations
JVM Flags
Flag |
Description |
|---|---|
|
Enables fused multiply-add (default: true). May cause issues on some platforms. |
|
Enables math simplifications (e.g., |
|
Enables more aggressive fast-math optimizations (default: true). |
|
Enables loop partial unrolling (default: false). Use |
|
Enables native math functions (default: true). |
CUDA C Backend Specific
TornadoVM’s CUDA C backend targets NVIDIA GPUs: it emits CUDA C, compiled to PTX via NVRTC, and is built on its own with make BACKEND=cuda. The flags below apply to the CUDA C backend specifically.
JVM Flags
Flag |
Description |
|---|---|
|
Passes additional flags to NVRTC when compiling the generated CUDA C source (default: none). |
|
Disables pinning host memory for faster host↔device transfers (default: true). |
|
Byte boundary that a native array’s first data element is aligned to, by prepending |
Note
The CUDA C backend’s code cache is controlled by properties that still carry the opencl prefix — inherited unchanged from the OpenCL backend’s code cache implementation, and not (yet) renamed for CUDA. They apply to both backends: -Dtornado.opencl.codecache.enable=true, -Dtornado.opencl.codecache.dump=true, -Dtornado.opencl.source.dump=true, -Dtornado.opencl.codecache.dir=PATH (default: /var/opencl-codecache), -Dtornado.opencl.source.dir=PATH (default: /var/opencl-compiler), -Dtornado.opencl.log.dir=PATH (default: /var/opencl-logs).
Metal Specific
JVM Flags
Flag |
Description |
|---|---|
|
Compiles Metal kernels with fast/relaxed math (Metal’s analogue of OpenCL’s |
|
Emits a |
|
Disables Metal profiling (default: true). |
|
Passes additional flags to the Metal compiler (default: none). |
Notes
All Java flags (those beginning with -Dtornado.) are defined in the TornadoOptions.java file.
TornadoVM CLI flags (those beginning with --) are mapped to Java flags by the Python interface for ease of use.
For example, --printKernel maps internally to -Dtornado.printKernel=true.