You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Ah, it's probably a miss then. We made sure Buffer.handle is a intptr_t in the beginning. Most likely it was changed recently to uintptr_t and I failed to capture it. Let me create an issue.
Do we want to address this issue when implementing resource handles (#1303)? In my work area I already created a small helper function to encapsulate the cast (an example for context handles is shown below). The idea is to overload this so that applying intptr to any handle will cast it to the "correct" integer-like type, which could be signed or unsigned. We could rename it if intptr is not clear enough.
cdef inline uintptr_t intptr(ContextHandle h) nogil:
"""Extract the handle as a uintptr_t integer address.
This is for use with internal APIs that expect integer addresses.
"""
return <uintptr_t>(h.get()[0])
Activity
leofang commentedon Dec 8, 2025
v0.4.0:
cuda-python/cuda_core/cuda/core/experimental/_memory.pyx
Line 57 in 84f5aae
Andy-Jost commentedon Dec 9, 2025
Do we want to address this issue when implementing resource handles (#1303)? In my work area I already created a small helper function to encapsulate the cast (an example for context handles is shown below). The idea is to overload this so that applying
intptrto any handle will cast it to the "correct" integer-like type, which could be signed or unsigned. We could rename it ifintptris not clear enough.leofang commentedon Dec 9, 2025
I am fine either way, this is not urgent, @Andy-Jost just let me know what you think 🙂
Andy-Jost commentedon Dec 10, 2025
If it's not urgent, then it will be rolled into my upcoming changes. All we'll need to do is close this issue with the PR.
RAII resource handles for CUDA objects (NVIDIA#1368)