You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have factory functions that can create bytes from a pointer:
createBytesWithBorrowedBuffer
createBytesWithOwnedBuffer
createBytesWithNewBuffer
We also have similar ones for strings. I think we should add something like this for arrays. We have makeArrayFromPtr from the 'external' array support, which can be used but that's not user-facing or stable. Here I'm thinking of something user-facing and more consistent with the bytes/string versions where we create an array from either a pointer or bytes. Note that for arrays we'll also want to provide a way to specify the domain, so the interface won't be exactly the same. Maybe something like:
See also #14291, which discusses coming up with consistent names for factory functions (we had some conversations recently about whether createBytesWith*Buffer is the naming we want to stick with longer term, and that thread has more information on where we ended up a few years ago.)
The text was updated successfully, but these errors were encountered:
While it's not a resolution to this issue, I've made a pull request that adds an overload for makeArrayFromPtr to construct (rectangular, dense, zero-based) multi-dimensional arrays from an external pointer, which supports my use case for GPU unified memory.
We have factory functions that can create bytes from a pointer:
createBytesWithBorrowedBuffer
createBytesWithOwnedBuffer
createBytesWithNewBuffer
We also have similar ones for strings. I think we should add something like this for arrays. We have
makeArrayFromPtr
from the 'external' array support, which can be used but that's not user-facing or stable. Here I'm thinking of something user-facing and more consistent with the bytes/string versions where we create an array from either a pointer or bytes. Note that for arrays we'll also want to provide a way to specify the domain, so the interface won't be exactly the same. Maybe something like:For some context/motivation, we started using
makeArrayFromPtr
in Arkouda Bears-R-Us/arkouda#880 and that made me want a stable version of it. Another user was also trying to create an array from an existing pointer in https://chapel.discourse.group/t/building-a-distributed-chapel-array-with-multiple-pointers/5501.See also #14291, which discusses coming up with consistent names for factory functions (we had some conversations recently about whether
createBytesWith*Buffer
is the naming we want to stick with longer term, and that thread has more information on where we ended up a few years ago.)The text was updated successfully, but these errors were encountered: