Repository navigation
Refactor arena_memory_resource to shared CCCL MR design - #2272
Merged
Merged
Conversation
Remove the Upstream template parameter from arena_memory_resource and split implementation into detail::arena_memory_resource_impl held via cuda::mr::shared_resource for reference-counted ownership. The outer class retains the device_memory_resource compatibility layer. New files: - cpp/include/rmm/mr/detail/arena_memory_resource_impl.hpp - cpp/src/mr/detail/arena_memory_resource_impl.cpp - cpp/src/mr/arena_memory_resource.cpp Updates benchmarks, tests, and Python bindings to use the non-template arena_memory_resource.
Use make_shared<arena_memory_resource>(...) directly instead of wrapping
in shared_ptr<device_memory_resource>{...}, matching the pool factories.
The power-law distribution and design-inspiration paragraphs were accidentally removed during the detemplate refactor.
bdice
commented
Mar 6, 2026
51 tasks done
3 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
arena_memory_resourceby removing theUpstreamtemplate parameterdetail::arena_memory_resource_implheld viacuda::mr::shared_resourcefor reference-counted, copyable ownershipdevice_memory_resourcelegacy compatibility layer (do_allocate,do_deallocate,do_is_equal)arena_memory_resourceThis follows the same pattern established in #2246, #2258, #2264, and #2265 for the other memory resources.
New files
cpp/include/rmm/mr/detail/arena_memory_resource_impl.hppdetail::arena_memory_resource_implclass declarationcpp/src/mr/detail/arena_memory_resource_impl.cppcpp/src/mr/arena_memory_resource.cppModified files
cpp/include/rmm/mr/arena_memory_resource.hppshared_resourcewrappingcpp/CMakeLists.txt.cppsource filescpp/tests/mr/arena_mr_tests.cpparena_memory_resource<device_memory_resource>→arena_memory_resourcecpp/tests/mr/mr_ref_arena_tests.cppArenaMRFixture+CcclMrRefTest/CcclMrRefAllocationTest/CcclMrRefTestMTinstantiationscpp/tests/mr/mr_ref_test.hppmake_arena()andarena_mrtype aliascpp/tests/mr/cccl_adaptor_tests.cppstatic_assert+ArenaMRAdaptorTestcpp/benchmarks/multi_stream_allocations/multi_stream_allocations_bench.cumake_arena()cpp/benchmarks/random_allocations/random_allocations.cppmake_arena()cpp/benchmarks/replay/replay.cppmake_arena()python/rmm/rmm/librmm/memory_resource.pxd[Upstream]template fromarena_memory_resourcepython/rmm/rmm/pylibrmm/memory_resource/_memory_resource.pyx