It should be possible to enable the profiler after the TornadoVM Execution Plans runs the first iteration. There was an issue with the profiler that was preventing the profiler from being registered if it was not enabled in the first iteration. This commit fixes and enables the profiler at any point during runtime via the execution plan.
Example:
TornadoExecutionPlan executionPlan = new TornadoExecutionPlan(taskGraph.snapshot());
// Runs without the profiler
executionPlan.execute();
// enable the profiler
TornadoExecutionResult executionResult = executionPlan.withProfiler(ProfilerMode.SILENT)
.execute();
// Query timers from the profiler
executionResult.getProfilerResult().getDeviceKernelTime();
Backend/s tested
Mark the backends affected by this PR.
[X] OpenCL
[X] PTX
[X] SPIRV
OS tested
Mark the OS where this PR is tested.
[X] Linux
[X] OSx
[X] Windows
Did you check on FPGAs?
If it is applicable, check your changes on FPGAs.
[ ] Yes
[X] No
How to test the new patch?
$ make
$ tornado-test -V -f uk.ac.manchester.tornado.unittests.profiler.TestProfiler
Description
It should be possible to enable the profiler after the TornadoVM Execution Plans runs the first iteration. There was an issue with the profiler that was preventing the profiler from being registered if it was not enabled in the first iteration. This commit fixes and enables the profiler at any point during runtime via the execution plan.
Example:
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?