Replies: 1 comment
-
The buffer protocol is specific to CPU arrays. Since much of the interesting array computation is on the GPU (or other accelerators) these days, nanobind has instead embraced the dlpack exchange protocol. You can still use the buffer protocol but this involves doing some lower level plumbing yourself: #699 (comment) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
First, sorry if it's already been asked and I missed it, I've seen tangentially-related question but not this exactly.
I'm trying to implement the buffer protocol on a class that already offers DLPack access, and as I was searching through the doc and the framework source code to see if there was anything that could help with that, I found nd_ndarray_tpbuffer. It's obviously not meant to be used externally, and as far as I can tell the type it's written for is only used once within the ndarray's from_cpp caster and dropped immediately, so it's clearly meant to be internal as well.
I was wondering if there was any design reason to not just expose it through a ndarray::get_buffer() function or similar, or if it's just low-priority / haven't got to it yet ? If it's the latter, I can propose a PR to add it.
Have a nice day, and keep up the good work ! Working with nanobind has been a blast so far.
Beta Was this translation helpful? Give feedback.
All reactions