-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(python): Implement array from buffer for non-CPU arrays (#550)
Requires building with (e.g.) `export NANOARROW_PYTHON_CUDA=/usr/local/cuda` and a `cupy` install: ```python import nanoarrow as na from nanoarrow import device import cupy as cp device.c_device_array(cp.array([1, 2, 3])) #> <nanoarrow.device.CDeviceArray> #> - device_type: CUDA <2> #> - device_id: 0 #> - array: <nanoarrow.c_array.CArray int64> #> - length: 3 #> - offset: 0 #> - null_count: 0 #> - buffers: (0, 133980798058496) #> - dictionary: NULL #> - children[0]: # Also roundtrips darray = device.c_device_array(cp.array([1, 2, 3])) cp.from_dlpack(darray.array.view().buffer(1)) #> array([1, 2, 3]) ``` --------- Co-authored-by: Dane Pitkin <[email protected]>
- Loading branch information
1 parent
48168e0
commit 6118e24
Showing
17 changed files
with
588 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.