Merged
Conversation
…diagnostics (rapidsai#2343) CCCL main (3.4.0) introduces two breaking changes that affect RMM: 1. **Deprecated default-alignment overloads**: `allocate_sync`, `deallocate_sync`, `allocate`, and `deallocate` on `resource_ref` types no longer provide a default alignment parameter. Under `-Werror`, the deprecation warning becomes a build failure. 2. **`basic_resource_ref` copy constructor is `__host__`-only**: `thrust_allocator` inherits `__host__ __device__` from `thrust::device_malloc_allocator`, so its implicitly-generated copy constructor calls the `__host__`-only `cccl_async_resource_ref` copy constructor, triggering NVCC error 20011. ### Changes - **`cpp/include/rmm/detail/cccl_adaptors.hpp`**: Pass `rmm::CUDA_ALLOCATION_ALIGNMENT` explicitly to all forwarded `allocate`/`deallocate`/`allocate_sync`/`deallocate_sync` calls on the underlying `resource_ref`, avoiding the deprecated default-alignment codepath. - **`cpp/include/rmm/mr/thrust_allocator_adaptor.hpp`**: Provide explicit copy/move constructors with `RMM_EXEC_CHECK_DISABLE` so the `#pragma nv_exec_check_disable` has a function body to attach to (it has no effect on `= default`). This mirrors the pattern used for `device_uvector`'s destructor and move constructor. - **`cpp/tests/mr/resource_ref_conversion_tests.cpp`**: Pass explicit alignment to `allocate_sync`/`deallocate_sync` on the type-erased `synchronous_resource_ref` to avoid the same deprecation error. Validated by building with CCCL main (clean 119/119 targets including tests and benchmarks). Authors: - Bradley Dice (https://github.com/bdice) Approvers: - Vyas Ramasubramani (https://github.com/vyasr) URL: rapidsai#2343
rapidsai#2331 fixed an issue with RMM using a deprecated type in its type annotations for `CudaStreamPool`. Our used the non-deprecated `rmm.pylibrmm.CudaStreamFlags`, which was technically incorrect according to mypy but worked at runtime because the two implementations were identical. Our CI (specifically our type-checking pre-commit check) didn't catch these because our *tests* don't have type annotations. This PR is a POC showing how this *should* have caught the issue, if we had type annotations on our tests. Authors: - Tom Augspurger (https://github.com/TomAugspurger) Approvers: - Bradley Dice (https://github.com/bdice) URL: rapidsai#2332
## Description
Fixes build errors like:
```cpp
FAILED: [code=1] benchmarks/CMakeFiles/RANDOM_ALLOCATIONS_BENCH.dir/random_allocations/random_allocations.cpp.o
sccache $BUILD_PREFIX/bin/x86_64-conda-linux-gnu-c++ -DBENCHMARK_STATIC_DEFINE -DCCCL_DISABLE_PDL -DCUB_DISABLE_NAMESPACE_MAGIC -DCUB_IGNORE_NAMESPACE_MAGIC_ERROR -DRMM_LOG_ACTIVE_LEVEL=RAPIDS_LOGGER_LOG_LEVEL_INFO -DTHRUST_DEVICE_SYSTEM=THRUST_DEVICE_SYSTEM_CUDA -DTHRUST_DISABLE_ABI_NAMESPACE -DTHRUST_HOST_SYSTEM=THRUST_HOST_SYSTEM_CPP -DTHRUST_IGNORE_ABI_NAMESPACE_ERROR -I$SRC_DIR/cpp -I$SRC_DIR/cpp/build/_deps/benchmark-src/include -I$SRC_DIR/cpp/include -I$SRC_DIR/cpp/build/include -I$SRC_DIR/cpp/build/_deps/cccl-src/lib/cmake/thrust/../../../thrust -I$SRC_DIR/cpp/build/_deps/cccl-src/lib/cmake/libcudacxx/../../../libcudacxx/include -I$SRC_DIR/cpp/build/_deps/cccl-src/lib/cmake/cub/../../../cub -I$SRC_DIR/cpp/build/_deps/nvtx3-src/c/include -fvisibility-inlines-hidden -fmessage-length=0 -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -isystem $PREFIX/include -I$PREFIX/targets/x86_64-linux/include -I$PREFIX/targets/x86_64-linux/include/cccl -I$BUILD_PREFIX/targets/x86_64-linux/include -I$BUILD_PREFIX/targets/x86_64-linux/include/cccl -O3 -DNDEBUG -std=gnu++20 -fPIE -Wall -Werror -Wextra -Wsign-conversion -Wno-unknown-pragmas -MD -MT benchmarks/CMakeFiles/RANDOM_ALLOCATIONS_BENCH.dir/random_allocations/random_allocations.cpp.o -MF benchmarks/CMakeFiles/RANDOM_ALLOCATIONS_BENCH.dir/random_allocations/random_allocations.cpp.o.d -o benchmarks/CMakeFiles/RANDOM_ALLOCATIONS_BENCH.dir/random_allocations/random_allocations.cpp.o -c $SRC_DIR/cpp/benchmarks/random_allocations/random_allocations.cpp
$SRC_DIR/cpp/benchmarks/random_allocations/random_allocations.cpp:200:70: error: 'benchmark::internal::Benchmark' is deprecated: Use ::benchmark::Benchmark instead [-Werror=deprecated-declarations]
200 | static void num_range(benchmark::internal::Benchmark* bench, int size)
| ^
In file included from $SRC_DIR/cpp/benchmarks/random_allocations/random_allocations.cpp:15:
$SRC_DIR/cpp/build/_deps/benchmark-src/include/benchmark/benchmark.h:1386:28: note: declared here
1386 | ::benchmark::Benchmark Benchmark;
| ^~~~~~~~~
$SRC_DIR/cpp/benchmarks/random_allocations/random_allocations.cpp:207:70: error: 'benchmark::internal::Benchmark' is deprecated: Use ::benchmark::Benchmark instead [-Werror=deprecated-declarations]
207 | static void size_range(benchmark::internal::Benchmark* bench, int num)
| ^
$SRC_DIR/cpp/build/_deps/benchmark-src/include/benchmark/benchmark.h:1386:28: note: declared here
1386 | ::benchmark::Benchmark Benchmark;
| ^~~~~~~~~
$SRC_DIR/cpp/benchmarks/random_allocations/random_allocations.cpp:214:65: error: 'benchmark::internal::Benchmark' is deprecated: Use ::benchmark::Benchmark instead [-Werror=deprecated-declarations]
214 | static void num_size_range(benchmark::internal::Benchmark* bench)
| ^
$SRC_DIR/cpp/build/_deps/benchmark-src/include/benchmark/benchmark.h:1386:28: note: declared here
1386 | ::benchmark::Benchmark Benchmark;
| ^~~~~~~~~
$SRC_DIR/cpp/benchmarks/random_allocations/random_allocations.cpp:224:59: error: 'benchmark::internal::Benchmark' is deprecated: Use ::benchmark::Benchmark instead [-Werror=deprecated-declarations]
224 | void benchmark_range(benchmark::internal::Benchmark* bench)
| ^
$SRC_DIR/cpp/build/_deps/benchmark-src/include/benchmark/benchmark.h:1386:28: note: declared here
1386 | ::benchmark::Benchmark Benchmark;
| ^~~~~~~~~
cc1plus: all warnings being treated as errors
```
## Checklist
- [x] I am familiar with the [Contributing
Guidelines](https://github.com/rapidsai/rmm/blob/HEAD/CONTRIBUTING.md).
- [x] New or existing tests cover these changes.
- [x] The documentation is up to date with these changes.
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
f56cbda to
6ed007b
Compare
rongou
approved these changes
Apr 4, 2026
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.
Description
Checklist