rmm
rmm copied to clipboard
[WIP] Interface rework
This is a proposal for the interface rework that would satisfy the requirements outlined in #660
The changes are:
- add notion of
memory_kind
andallocation_order
- add a base class that mimics
pmr::memory_resource
, but is templated with respect tomemory_kind
andallocation_order
- add a base class
stream_aware_memory_resource
which covers the functionality previously implemented bydevice_memory_resource
, but with configurablememory_kind
- make
host_memory_resource
an alias formemory_resource<memory_kind::host, allocation_order::host>
- make
device_memory_resource
derive fromstream_aware_resource<memory_kind::device>
- add synchronous calls to
stream_aware_memory_resource
by inheriting frommemory_resource<kind, allocation_order::host>
- add default implementation for synchronous allocations
- remove default stream argument
- add
default_alignment<memory_kind>
constant, which resolves toalignof(max_align_t)
for host and 256B for others
Behavior changes:
- a call to
stream_aware_memory_resource::allocate
without a stream will cause synchronization (to run on default stream, user needs to explicitly specify the default stream)
Breaking changes:
-
do_allocate
anddo_deallocate
instream_aware_memory_resource
have been renamed to avoid an unfixable warning when compiling with NVCC (see below) -
do_alloc_async
/do_dealloc_async
now accept an alignment
NVCC warning problem:
Overriding a subset of virtual function's overloads causes a warning about hiding a virtual function. It's impossible to disable this warning or to mitigate it in the code, because the functions involved are private and therefore not accessible in the derived class - so we can't add dummy overrides or add using base::do_allocate
.
Can one of the admins verify this patch?
Can one of the admins verify this patch?
Can one of the admins verify this patch?
This PR has been labeled inactive-30d
due to no recent activity in the past 30 days. Please close this PR if it is no longer required. Otherwise, please respond with a comment indicating any updates. This PR will be labeled inactive-90d
if there is no activity in the next 60 days.
@mzient can we close this?
This PR has been labeled inactive-30d
due to no recent activity in the past 30 days. Please close this PR if it is no longer required. Otherwise, please respond with a comment indicating any updates. This PR will be labeled inactive-90d
if there is no activity in the next 60 days.
@harrism This PR is here for visibility - it's the code used by DALI. If you think it should be closed, it can be, but that's probably where I'll keep adjusting RMM to the proposed libcu++ memory_resource interfaces.
This PR has been labeled inactive-30d
due to no recent activity in the past 30 days. Please close this PR if it is no longer required. Otherwise, please respond with a comment indicating any updates. This PR will be labeled inactive-90d
if there is no activity in the next 60 days.
This PR has been labeled inactive-90d
due to no recent activity in the past 90 days. Please close this PR if it is no longer required. Otherwise, please respond with a comment indicating any updates.
Superseded by #1095. Closing.,