This pull request introduces a new method concat to multiple instances of TornadoNativeArray types into a single array. This aims at providing a straightforward and efficient way to merge several arrays by using Memory Segment copies and without the overhead of manual array copying.
Example usage:
IntArray a = new IntArray(numElements);
IntArray b = new IntArray(numElements);
IntArray e = new IntArray(numElements);
a.init(100);
b.init(5);
e.init(12);
IntArray c = IntArray.concat(a, b, e);
Example size output;
Array a size: 256
Array b size: 256
Array e size: 256
---------------------------------
Concat Array c size: 768
---------------------------------
Backend/s tested
Mark the backends affected by this PR.
[x] OpenCL
[ ] PTX
[ ] SPIRV
OS tested
Mark the OS where this PR is tested.
[x] Linux
[ ] OSx
[ ] 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 jdk21 backend=opencl
tornado-test -V --fast uk.ac.manchester.tornado.unittests.api.TestConcat
Description
This pull request introduces a new method concat to multiple instances of TornadoNativeArray types into a single array. This aims at providing a straightforward and efficient way to merge several arrays by using Memory Segment copies and without the overhead of manual array copying.
Example usage:
Example size output;
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?