Skip to content
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

Add __cuda_array_interface__ to itk::CudaImage #10

Open
thewtex opened this issue Apr 12, 2022 · 3 comments · May be fixed by #42
Open

Add __cuda_array_interface__ to itk::CudaImage #10

thewtex opened this issue Apr 12, 2022 · 3 comments · May be fixed by #42

Comments

@thewtex
Copy link

thewtex commented Apr 12, 2022

A __cuda_array_interface__ method could prevent CPU/GPU memory transfer when itk.CudaImage is used with cupy, pytorch, etc.

@gigony you shared a nice reference of how this is implemented in cuCIM, but I am having a hard time finding it in a quick grep of the cucim repository. Any pointers?

Edit: Found it :-):

https://github.com/rapidsai/cucim/blob/4061b7e00c5b10f18f04f3c356b32a42c081de4f/python/pybind11/cucim_py.cpp#L628-L631

CC @SimonRit @LucasGandel

@gigony
Copy link

gigony commented Apr 26, 2022

Hi @thewtex

For supporting __cuda_array_interface__, you can reference this code implemented in cuCIM.

@jakirkham
Copy link

jakirkham commented Apr 26, 2022

Also here's some code from CuPy for consuming/producing __cuda_array_interface__ objects:

LucasGandel added a commit to LucasGandel/ITKCudaCommon that referenced this issue Aug 9, 2024
Adapt ITK's PyBuffer approach to inject __cuda_array_interface__ in wrapped
code.
Closes RTKConsortium#10
@LucasGandel LucasGandel linked a pull request Aug 9, 2024 that will close this issue
6 tasks
@LucasGandel
Copy link
Collaborator

Soon addressed by #42.
Thank you all for your valuable insight ❤️ 🚀 💯

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants