Provide a nice wrapper over `DeviceMemoryResource` and `_SynchronousMemoryResource`
@shwina is already working on this.
Since Jun 25, 2025.
- Dominant language
- Cython
- Stars
- 3.4k
- Forks
- 329
- Avg merge
- 1d 23h
- Merged PRs (30d)
- 116
Description
Need to check against Device().properties.memory_pools_supported to decide if we use DeviceMemoryResource or _SynchronousMemoryResource
Any chance we can turn this into a wrapper function, or just have
DeviceMemoryResource()return the appropriate type when constructed?
Originally posted by @shwina in https://github.com/NVIDIA/cuda-python/pull/717#discussion_r2167323036
We could consider adding a helper function under the cuda.core.experimental.utils module. Later we might reimplement DeviceMemoryResource using cudax::device_memory_resource or cuda::device_memory_pool, so if we make DeviceMemoryResource to wrap both cudaMallocFromPoolAsync and cudaMalloc now, the re-implementation would become harder later.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.