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

cuda-python-bugfix: allow passage of cuda stream objects or pointers #419

Closed

Conversation

blackwer
Copy link
Member

Pointers are dangerous because they aren't reference counted and so can be deleted before cufinufft cleans up (#417). This patch allows the user to pass either a stream object OR a pointer in the gpu_stream argument of Plan

Might warrant discussion of if we should just scrap the raw pointer altogether

Pointers are dangerous because they aren't reference counted and so can be deleted before
cufinufft cleans up (flatironinstitute#417). This patch allows the user to pass either a stream object OR a
pointer in the `gpu_stream` argument of Plan
@ahbarnett
Copy link
Collaborator

Hi @janden - any chance you can check over this PR sometime? Thanks, Alex

Copy link
Collaborator

@janden janden left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the delay. This looks great!

If I understand correctly, we still have an issue if a user passes a raw pointer (since we can't make sure it's properly reference-counted)? Then yes, it would make sense to remove this possibility (can't imagine that anyone would use it, especially given that we require the input array to be from one of the frameworks). However, since it's already part of the 2.2 API, maybe we deprecate for now and remove in 2.4?

@blackwer
Copy link
Member Author

blackwer commented Feb 5, 2024

However, since it's already part of the 2.2 API, maybe we deprecate for now and remove in 2.4?

I've added a deprecation warning when it finds a raw pointer. I'll merge tomorrow barring any objections

@janden
Copy link
Collaborator

janden commented Feb 5, 2024

👍

@blackwer
Copy link
Member Author

blackwer commented Feb 6, 2024

closes #417

@blackwer blackwer closed this Feb 6, 2024
@blackwer blackwer deleted the ref-counted-streams branch February 6, 2024 13:02
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 this pull request may close these issues.

3 participants