This repository contains examples and tests shown at the NYJavaSIG TornadoVM talk in Feb 2021
Link to the event: Video Recording
- Install TornadoVM. Full guideline here
- OpenCL or PTX device:
- If OpenCL is selected, installation with OpenCL >= 1.2 installed
- If the PTX backend is selected, CUDA >= 10
- Maven 3.6
Once TornadoVM is installed, please configure the sources.sh
file with your paths to the JAVA_HOME
and TORNADO_ROOT
.
All these examples and scripts uses Java 8. For JDK >= 11, please file an issue, and we can work through it together.
## Provide the paths to your path to the OpenJDK+JVMCI bin
export JAVA_HOME=<path-to-OpenJDK>
# Provide your path to the TornadoVM root folder
export TORNADO_ROOT=<path-to-TornadoVM>
## Keep these env-variables are they are
export PATH="${PATH}:${TORNADO_ROOT}/bin/bin/"
export TORNADO_SDK=${TORNADO_ROOT}/bin/sdk
export CLASSPATH=target/tornado-1.0-SNAPSHOT.jar
Run:
. sources.sh
Compile this tutorial:
mvn clean package
This example is taken from the example-suite of TornadoVM:
How to run it?
tornado nyjavasig.DFT <inputSize> <version:sequential|tornadoVM> <numIterations>
Example:
# Running Sequential
tornado nyjavasig.DFT 8192 sequential 10
# Running Parallel Version with TornadoVM
tornado nyjavasig.DFT 8192 tornado 10
Changing device?
# Running Parallel Version with TornadoVM
tornado --debug -Ds0.t0.device=0:1 nyjavasig.DFT 8192 tornado 10
Print Kernel:
# Running Parallel Version with TornadoVM
tornado --printKernel --debug -Ds0.t0.device=0:1 nyjavasig.DFT 8192 tornado 10
Note, you need an FPGA to run these demos.
tornado --debug --printKernel -Ds0.t0.device=0:2 -Dtornado.fpga.conf.file=dftFPGA.conf nyjavasig.DFT 8192 tornado 5
Running with Emulation mode:
export CL_CONTEXT_EMULATOR_DEVICE_INTELFPGA=1
tornado --debug --printKernel -Ds0.t0.device=0:2 -Dtornado.fpga.conf.file=dftFPGA.conf nyjavasig.DFT 8192 tornado 5
tornado --debug -Ds0.t0.device=0:2 -Dtornado.fpga.conf.file=blackScholes.conf nyjavasig.BlackScholes 33554432 5
Demo using the Client-Server application to change the devices through the client:
How to run it?:
## Run Server in one terminal
./runServer.sh
## Client in another terminal
./runClient.sh
cd python
## Run TornadoVM accelerated (512 x 512 Doubles)
./runPython.sh mxmWithTornadoVM.py
IGV can be downloaded from Oracle OTN
Run IGV 20.2.0
~/Downloads/20.2.0/idealgraphvisualizer/bin/idealgraphvisualizer &
Run an example (vector add)
tornado --igv nyjavasig.TestTornado