beehive-lab / TornadoVM

TornadoVM: A practical and efficient heterogeneous programming framework for managed languages
https://www.tornadovm.org
Apache License 2.0
1.15k stars 109 forks source link

Option to select the SPIR-V Runtime Dispatcher #451

Closed jjfumero closed 2 weeks ago

jjfumero commented 2 weeks ago

Description

This PR adds an option in the TornadoOptions to select which runtime we want as default to dispatch SPIR-V code. By default. TornadoVM currently selects the OpenCL, but the user now can override this by using the following option:

This is useful to pass, for example, all tests with another Runtime Dispatcher for SPIR-V.

$ make tests-spirv-levelzero 

$ make tests-spirv-opencl

Problem description

n/ a.

Backend/s tested

Mark the backends affected by this PR.

OS tested

Mark the OS where this PR is tested.

Did you check on FPGAs?

If it is applicable, check your changes on FPGAs.

How to test the new patch?

make BACKEND=spirv

tornado --jvm="-Dtornado.spirv.dispatcher=opencl" uk.ac.manchester.tornado.drivers.TornadoDeviceQuery --params="verbose"

tornado --jvm="-Dtornado.spirv.dispatcher=levelzero" uk.ac.manchester.tornado.drivers.TornadoDeviceQuery --params="verbose"

## If set a random value
tornado --jvm="-Dtornado.spirv.dispatcher=foo" uk.ac.manchester.tornado.drivers.TornadoDeviceQuery --params="verbose"

#We get an error