cuda-python icon indicating copy to clipboard operation
cuda-python copied to clipboard

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

Open fjwillemsen opened this issue 1 year ago • 1 comments

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.

fjwillemsen avatar Mar 08 '24 07:03 fjwillemsen

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 avatar Mar 11 '24 23:03 vzhurba01

Resolved with latest CUDA Python 12.5.0 release. Closing.

vzhurba01 avatar May 21 '24 16:05 vzhurba01