[FEA]: Add a release()
method to cuda.core.Buffer
to side-step the Python garbage collector
#567
Labels
Milestone
Uh oh!
There was an error while loading. Please reload this page.
Is this a duplicate?
Area
cuda.core
Is your feature request related to a problem? Please describe.
@realarnavgoel brought up this issue offline that we currently have a fallback weak finalizer
cuda-python/cuda_core/cuda/core/experimental/_memory.py
Line 51 in d425a88
in case users forget to explicitly call
.close()
to free the memory. This could interfere with projects such as nvmath-python and nvSHMEM who require explicit control over the buffer lifetime and deallocation timing.Describe the solution you'd like
We discussed offline and came up with this proposal that we'll add a
.release()
method to the buffer object. The idea is that if it is called, the weak finalizer will be unregistered, so that the only way to free the buffer is to call.close()
explicitly later.Describe alternatives you've considered
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: