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
Just as we have using_allocator for device memory, it would be helpful to have a similar function for pinned memory. This way one could affect the pinned memory allocator used in a with-block of code
The text was updated successfully, but these errors were encountered:
Just to make the scope of this issue clear: does the API intends to change the NumPy allocator (numpy/numpy#17582), or just change how numpy.ndarray is allocated internally in CuPy?
Oh was just thinking this would be another way to change how alloc_pinned_memory behaves in CuPy
Yeah it will be interesting to see what that that NumPy API looks like when it is finalized. Right now it is just a C API AFAICT. Leo mentioned there would be some interest in using this from Python ( numpy/numpy#17467 (comment) )
The NEP for custom NumPy allocators (numpy/numpy#18805) is merged as a draft. I think it's good to be able to use this new capability, but it requires
A newer NumPy release that contains this capability
Accessing the NumPy C API which is never done in CuPy so far
I think one viable path is to dlopen NumPy's shared library and get the function pointers. This way if the NumPy version is old and dlopen fails, we can just raise an error. We do not have to make NumPy a build-time dependency either. WDYT @kmaehashi@jakirkham?
Just as we have
using_allocator
for device memory, it would be helpful to have a similar function for pinned memory. This way one could affect the pinned memory allocator used in awith
-block of codeThe text was updated successfully, but these errors were encountered: