-
Notifications
You must be signed in to change notification settings - Fork 236
feat: allow constructing SMV from numpy arrays #1428
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Auto-sync is disabled for ready for review pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
dd893ce to
b140ed6
Compare
|
/ok to test |
This comment has been minimized.
This comment has been minimized.
b140ed6 to
9d88940
Compare
|
/ok to test |
|
/ok to test |
1 similar comment
|
/ok to test |
b7f7313 to
a87b279
Compare
|
/ok to test |
|
|
Ideally we want to always use |
|
Yes, structured arrays, strings, bytes, and whatever other things DLPack doesn't support. |
|
Ah right, thx for reminder... |
Summary
Add the
StridedMemoryView.from_array_interface()class method to supportcreating memory views from objects implementing the NumPy Array Interface
protocol (
__array_interface__).Changes
New API (
cuda_core/cuda/core/_memoryview.pyx:156-163)StridedMemoryView.from_array_interface(obj)classmethod for creatingmemory views from array interface objects
view_as_array_interface()helper function that:shape,dtype,strides, andreadonlyflag from__array_interface__dictTest Coverage (
cuda_core/tests/test_utils.py:464-515)Note: This PR builds on #1425 (structured dtype support). Only review the latest commitdd893ce- previous commits are from the base PR.