beehive-lab / TornadoVM

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

Implement memory limit functionality per ExecutionPlan in the TornadoVM API #323

Closed mikepapadim closed 8 months ago

mikepapadim commented 9 months ago

Description

This PR introduces withMemoryLimit() option in TornadoVM's execution plan. With this feature, the API provides the means to execute a TaskGraph only if fullfil specific memory constraints.

The use of the withMemoryLimit() will cause TornadoVM to throw an OutOfMemoryException in order to resize its buffers or increase the device memory limit or use the batch processing utilities.

 executionPlan.withMemoryLimit("1GB").execute();

Backend/s tested

Mark the backends affected by this PR.

OS tested

Mark the OS where this PR is tested.

How to test the new patch?

tornado-test -V uk.ac.manchester.tornado.unittests.memoryplan.TestWithMemoryLimit

mikepapadim commented 9 months ago

I need to pass the formatter properly.

jjfumero commented 8 months ago

Is this PR ready?

mikepapadim commented 8 months ago

This is ready now