Skip to content

Commit 2373199

Browse files
authored
Remove legacy memory resource interface in favor of CCCL interface (#2150)
This removes the deprecated legacy memory resource interface. Part of #2011. See previous work: - #2017 - #2112 - #2126 - #2128 Authors: - Bradley Dice (https://github.com/bdice) Approvers: - Vyas Ramasubramani (https://github.com/vyasr) - Lawrence Mitchell (https://github.com/wence-) URL: #2150
1 parent 2a5a920 commit 2373199

File tree

5 files changed

+0
-387
lines changed

5 files changed

+0
-387
lines changed

cpp/CMakeLists.txt

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,6 @@ option(BUILD_BENCHMARKS "Configure CMake to build (google) benchmarks" OFF)
3737
# This is mostly so that dependent libraries are configured in shared mode for downstream dependents
3838
# of RMM that get their common dependencies transitively.
3939
option(BUILD_SHARED_LIBS "Build RMM shared libraries" ON)
40-
option(RMM_ENABLE_LEGACY_MR_INTERFACE "Enable legacy memory resource interface" ON)
41-
option(RMM_DEPRECATE_LEGACY_MR_INTERFACE
42-
"Enable deprecation warnings for legacy memory resource interface" ON)
4340
option(RMM_DEPRECATE_MR_DEVICE_HEADERS "Enable deprecation warnings for rmm/mr/device/* headers" ON)
4441
set(RMM_LOGGING_LEVEL
4542
"INFO"
@@ -51,8 +48,6 @@ message(VERBOSE "RMM: Build with NVTX support: ${RMM_NVTX}")
5148
# Set logging level. Must go before including gtests and benchmarks. Set the possible values of
5249
# build type for cmake-gui.
5350
message(STATUS "RMM: RMM_LOGGING_LEVEL = '${RMM_LOGGING_LEVEL}'")
54-
message(STATUS "RMM: Legacy MR interface enabled: ${RMM_ENABLE_LEGACY_MR_INTERFACE}")
55-
message(STATUS "RMM: Legacy MR interface deprecated: ${RMM_DEPRECATE_LEGACY_MR_INTERFACE}")
5651
message(STATUS "RMM: Legacy rmm/mr/device headers deprecated: ${RMM_DEPRECATE_MR_DEVICE_HEADERS}")
5752

5853
# cudart can be linked statically or dynamically
@@ -132,16 +127,6 @@ if(RMM_NVTX)
132127
target_compile_definitions(rmm PUBLIC RMM_NVTX)
133128
endif()
134129

135-
# Control legacy MR interface visibility
136-
if(RMM_ENABLE_LEGACY_MR_INTERFACE)
137-
target_compile_definitions(rmm PUBLIC RMM_ENABLE_LEGACY_MR_INTERFACE)
138-
endif()
139-
140-
# Control legacy MR interface deprecation warnings
141-
if(RMM_DEPRECATE_LEGACY_MR_INTERFACE)
142-
target_compile_definitions(rmm PUBLIC RMM_DEPRECATE_LEGACY_MR_INTERFACE)
143-
endif()
144-
145130
# Control rmm/mr/device header deprecation warnings
146131
if(RMM_DEPRECATE_MR_DEVICE_HEADERS)
147132
target_compile_definitions(rmm PUBLIC RMM_DEPRECATE_MR_DEVICE_HEADERS=1)

cpp/include/rmm/detail/cccl_adaptors.hpp

Lines changed: 0 additions & 122 deletions
Original file line numberDiff line numberDiff line change
@@ -23,45 +23,6 @@ class cccl_resource_ref : public ResourceType {
2323

2424
cccl_resource_ref(base&& other) : base(std::move(other)) {}
2525

26-
#ifdef RMM_ENABLE_LEGACY_MR_INTERFACE
27-
#ifdef RMM_DEPRECATE_LEGACY_MR_INTERFACE
28-
[[deprecated("This function is deprecated. Use allocate_sync(std::size_t bytes) instead.")]]
29-
#endif
30-
void* allocate(std::size_t bytes)
31-
{
32-
return this->allocate_sync(bytes);
33-
}
34-
35-
#ifdef RMM_DEPRECATE_LEGACY_MR_INTERFACE
36-
[[deprecated(
37-
"This function is deprecated. Use allocate_sync(std::size_t bytes, std::size_t alignment) "
38-
"instead.")]]
39-
#endif
40-
void* allocate(std::size_t bytes, std::size_t alignment)
41-
{
42-
return this->allocate_sync(bytes, alignment);
43-
}
44-
45-
#ifdef RMM_DEPRECATE_LEGACY_MR_INTERFACE
46-
[[deprecated(
47-
"This function is deprecated. Use deallocate_sync(void* ptr, std::size_t bytes) instead.")]]
48-
#endif
49-
void deallocate(void* ptr, std::size_t bytes) noexcept
50-
{
51-
return this->deallocate_sync(ptr, bytes);
52-
}
53-
54-
#ifdef RMM_DEPRECATE_LEGACY_MR_INTERFACE
55-
[[deprecated(
56-
"This function is deprecated. Use deallocate_sync(void* ptr, std::size_t bytes, std::size_t "
57-
"alignment) instead.")]]
58-
#endif
59-
void deallocate(void* ptr, std::size_t bytes, std::size_t alignment) noexcept
60-
{
61-
return this->deallocate_sync(ptr, bytes, alignment);
62-
}
63-
#endif // RMM_ENABLE_LEGACY_MR_INTERFACE
64-
6526
void* allocate_sync(std::size_t bytes) { return base::allocate_sync(bytes); }
6627

6728
void* allocate_sync(std::size_t bytes, std::size_t alignment)
@@ -90,89 +51,6 @@ class cccl_async_resource_ref : public ResourceType {
9051
cccl_async_resource_ref(base const& other) : base(other) {}
9152
cccl_async_resource_ref(base&& other) : base(std::move(other)) {}
9253

93-
#ifdef RMM_ENABLE_LEGACY_MR_INTERFACE
94-
#ifdef RMM_DEPRECATE_LEGACY_MR_INTERFACE
95-
[[deprecated("This function is deprecated. Use allocate_sync(std::size_t bytes) instead.")]]
96-
#endif
97-
void* allocate(std::size_t bytes)
98-
{
99-
return this->allocate_sync(bytes);
100-
}
101-
102-
#ifdef RMM_DEPRECATE_LEGACY_MR_INTERFACE
103-
[[deprecated(
104-
"This function is deprecated. Use allocate_sync(std::size_t bytes, std::size_t alignment) "
105-
"instead.")]]
106-
#endif
107-
void* allocate(std::size_t bytes, std::size_t alignment)
108-
{
109-
return this->allocate_sync(bytes, alignment);
110-
}
111-
112-
#ifdef RMM_DEPRECATE_LEGACY_MR_INTERFACE
113-
[[deprecated(
114-
"This function is deprecated. Use deallocate_sync(void* ptr, std::size_t bytes) instead.")]]
115-
#endif
116-
void deallocate(void* ptr, std::size_t bytes) noexcept
117-
{
118-
return this->deallocate_sync(ptr, bytes);
119-
}
120-
121-
#ifdef RMM_DEPRECATE_LEGACY_MR_INTERFACE
122-
[[deprecated(
123-
"This function is deprecated. Use deallocate_sync(void* ptr, std::size_t bytes, std::size_t "
124-
"alignment) instead.")]]
125-
#endif
126-
void deallocate(void* ptr, std::size_t bytes, std::size_t alignment) noexcept
127-
{
128-
return this->deallocate_sync(ptr, bytes, alignment);
129-
}
130-
131-
#ifdef RMM_DEPRECATE_LEGACY_MR_INTERFACE
132-
[[deprecated(
133-
"This function is deprecated. Use allocate(cuda_stream_view stream, std::size_t bytes) "
134-
"instead.")]]
135-
#endif
136-
void* allocate_async(std::size_t bytes, cuda_stream_view stream)
137-
{
138-
return this->allocate(stream, bytes);
139-
}
140-
141-
#ifdef RMM_DEPRECATE_LEGACY_MR_INTERFACE
142-
[[deprecated(
143-
"This function is deprecated. Use allocate(cuda_stream_view stream, std::size_t bytes, "
144-
"std::size_t alignment) instead.")]]
145-
#endif
146-
void* allocate_async(std::size_t bytes, std::size_t alignment, cuda_stream_view stream)
147-
{
148-
return this->allocate(stream, bytes, alignment);
149-
}
150-
151-
#ifdef RMM_DEPRECATE_LEGACY_MR_INTERFACE
152-
[[deprecated(
153-
"This function is deprecated. Use deallocate(cuda_stream_view stream, void* ptr, std::size_t "
154-
"bytes) instead.")]]
155-
#endif
156-
void deallocate_async(void* ptr, std::size_t bytes, cuda_stream_view stream) noexcept
157-
{
158-
return this->deallocate(stream, ptr, bytes);
159-
}
160-
161-
#ifdef RMM_DEPRECATE_LEGACY_MR_INTERFACE
162-
[[deprecated(
163-
"This function is deprecated. Use deallocate(cuda_stream_view stream, void* ptr, std::size_t "
164-
"bytes, std::size_t alignment) instead.")]]
165-
#endif
166-
void deallocate_async(void* ptr,
167-
std::size_t bytes,
168-
std::size_t alignment,
169-
cuda_stream_view stream) noexcept
170-
{
171-
return this->deallocate(stream, ptr, bytes, alignment);
172-
}
173-
174-
#endif // RMM_ENABLE_LEGACY_MR_INTERFACE
175-
17654
void* allocate_sync(std::size_t bytes) { return base::allocate_sync(bytes); }
17755

17856
void* allocate_sync(std::size_t bytes, std::size_t alignment)

0 commit comments

Comments
 (0)