beehive-lab / TornadoVM

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

New calls to profile the Execution Plan: withThreadInfo and withPrintKernel #340

Closed jjfumero closed 6 months ago

jjfumero commented 6 months ago

Description

This PR enables two more methods in the TornadoExecutionPlan API to debug the kernels and the code dispatcher (number of threads and device in which each task in an immutable task-graph will be executed).

This PR introduces the following methods in the task-graph:

TornadoExecutionPlan executionPlan = new TornadoExecutionPlan(immutableTaskGraph);
executionPlan
       .withThreadInfo()  // new method to print the thread deployment - same action as --threadInfo from the command line
       .withPrintKernel() // new method to dump the generated kernel. Same action as the --printKernel from the command line 
       .execute();

Problem description

Apart from the

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 
$ tornado-test -V uk.ac.manchester.tornado.unittests.foundation.TestIntegers#test06
$ tornado-test -V uk.ac.manchester.tornado.unittests.foundation.TestIntegers#test07
$ tornado-test -V uk.ac.manchester.tornado.unittests.profiler.TestProfiler#testKernelOnAndOff 
$ tornado-test -V uk.ac.manchester.tornado.unittests.profiler.TestProfiler#testThreadInfoOnAndOff
$ make tests