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

Fix the tests in TestInitDataTypes #360

Closed jjfumero closed 5 months ago

jjfumero commented 5 months ago

Description

Fixes the tests in the TestInitDataTypes class

@gigiblender completed my pending work towards the support of Factory Methods for the Panama Collections.

This PR allows developers to use factory methods from the TornadoNativeArray types that can be combined into Tornado Task-Graphs

FloatArray array = new FloatArray(1024 * 1024);
TaskGraph taskGraph = new TaskGraph("graph") //
    .transferToDevice(DataTransferMode.FIRST_EXECUTION, array) //
    .task("init", FloatArray::initialize, array, 2.0f) //
    .transferToHost(DataTransferMode.EVERY_EXECUTION, array);

ImmutableTaskGraph immutableTaskGraph = taskGraph.snapshot();
TornadoExecutionPlan executionPlan = new TornadoExecutionPlan(immutableTaskGraph);
executionPlan.execute();

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?

Run the tests, including the TestInitDataTypes

tornado-test -V uk.ac.manchester.tornado.unittests.api.TestInitDataTypes