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

cudart.cudaMemset should take a device pointer, but doesn't #58

Closed
fjwillemsen opened this issue Mar 8, 2024 · 2 comments
Closed

cudart.cudaMemset should take a device pointer, but doesn't #58

fjwillemsen opened this issue Mar 8, 2024 · 2 comments

Comments

@fjwillemsen
Copy link

According to the documentation, cudart.cudaMemset should take a device pointer as first argument.
However, with version 12.3.0 on Python 3.11.7, this results in the following error:
TypeError: Provided argument is of type <class 'cuda.cuda.CUdeviceptr'> but expected Type <class 'NoneType'>, <class 'type'> or object with Buffer Protocol.

@vzhurba01
Copy link
Collaborator

I see that you're trying to interop between Driver's cuda.CUdeviceptr type and the Runtime's cudart.cudaMemset API. While there already exists some interop in Runtime, this does looks like a good area for extending it.

In the meantime, as a WAR you can call the type's __int__() method to get a Runtime compatible value.

@vzhurba01
Copy link
Collaborator

Resolved with latest CUDA Python 12.5.0 release. Closing.

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

No branches or pull requests

2 participants