Closed mikepapadim closed 5 months ago
I am confused. The withHeader
version, does it always return +24 bytes, or it returns the bytes specified in TornadoNativeArray.ARRAY_HEADER
?
I am confused. The
withHeader
version, does it always return +24 bytes, or it returns the bytes specified inTornadoNativeArray.ARRAY_HEADER
?
withHeader
returns always number of bytes including the TornadoNativeArray.ARRAY_HEADER
I am confused. The
withHeader
version, does it always return +24 bytes, or it returns the bytes specified inTornadoNativeArray.ARRAY_HEADER
?
withHeader
returns always number of bytes including theTornadoNativeArray.ARRAY_HEADER
So please, update the PR description with this.
I am confused. The
withHeader
version, does it always return +24 bytes, or it returns the bytes specified inTornadoNativeArray.ARRAY_HEADER
?
withHeader
returns always number of bytes including theTornadoNativeArray.ARRAY_HEADER
So please, update the PR description with this.
done
Unittests are passing on OSx 14.4
@jjfumero done
ok, thanks. the PR looks good to me.
Description
This PR adds support to obtain a MemorySegment from TornadoNativeArray types with and without the header bytes.
MemorySegment getSegment()
returns a memory segment excluding the Tornado header.MemorySegment getSegmentWithHeader()
returns a memory segment as allocated for TornadoVM including the Tornado header (24bytes).long getNumBytesOfSegmentWithHeader()
returns Segment's number of bytes including the Tornado header.long getNumBytesOfSegment()
returns Segment's number of bytes excluding the Tornado header.By having distinct funtion in the above auxiliry methods we can have interoperoability when using Segments for GPU execution through the Taskgraph API and Vector API when using any of the TornadoNative types.
Also, refactor internally methods that operate on memory segments to be named explictly as
getSegmentWithHeader
.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?