Skip to content

Fix deprecation warning: declaring default stream as cuda::stream_ref - #23865

Open
davidwendt wants to merge 3 commits into
NVIDIA:mainfrom
davidwendt:fix-deprecation-warning
Open

Fix deprecation warning: declaring default stream as cuda::stream_ref#23865
davidwendt wants to merge 3 commits into
NVIDIA:mainfrom
davidwendt:fix-deprecation-warning

Conversation

@davidwendt

@davidwendt davidwendt commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Description

Fixes a deprecation warning where cudf::stream_ref was variable was declared without a stream.

[285+64+832=1180] Building CXX object benchmarks/CMakeFiles/MERGE_NVBENCH.dir/merge/merge_lists.cpp.o
/cudf/cpp/benchmarks/merge/merge_lists.cpp: In function 'void nvbench_merge_list(nvbench::state&)':
/cudf/cpp/benchmarks/merge/merge_lists.cpp:17:20: warning: 'constexpr cuda::__4::stream_ref::stream_ref()' is deprecated: Using the default/null stream is generally discouraged. If you need to use it, please construct a stream_ref from cudaStream_t{nullptr} [-Wdeprecated-declarations]
   17 |   cuda::stream_ref stream;
      |                    ^~~~~~
In file included from /cudf/cpp/build/_deps/cccl-src/lib/cmake/libcudacxx/../../../libcudacxx/include/cuda/__stream/get_stream.h:26,
                 from /cudf/cpp/build/_deps/cccl-src/lib/cmake/libcudacxx/../../../libcudacxx/include/cuda/stream_ref:56,
                 from /conda/envs/rapids/include/rmm/cuda_stream_view.hpp:10,
                 from /cudf/cpp/include/cudf/utilities/default_stream.hpp:10,
                 from /cudf/cpp/include/cudf/column/column_view.hpp:8,
                 from /cudf/cpp/include/cudf/column/column.hpp:7,
                 from /cudf/cpp/include/cudf/table/table.hpp:7,
                 from /cudf/cpp/benchmarks/common/generate_nested_types.hpp:8,
                 from /cudf/cpp/benchmarks/merge/merge_lists.cpp:6:
/cudf/cpp/build/_deps/cccl-src/lib/cmake/libcudacxx/../../../libcudacxx/include/cuda/__stream/stream_ref.h:63:3: note: declared here
   63 |   stream_ref() = default;
      |   ^~~~~~~~~~
[280+64+837=1180] Building CXX object benchmarks/CMakeFiles/MERGE_NVBENCH.dir/merge/merge_structs.cpp.o
/cudf/cpp/benchmarks/merge/merge_structs.cpp: In function 'void nvbench_merge_struct(nvbench::state&)':
/cudf/cpp/benchmarks/merge/merge_structs.cpp:17:20: warning: 'constexpr cuda::__4::stream_ref::stream_ref()' is deprecated: Using the default/null stream is generally discouraged. If you need to use it, please construct a stream_ref from cudaStream_t{nullptr} [-Wdeprecated-declarations]
   17 |   cuda::stream_ref stream;
      |                    ^~~~~~
In file included from /cudf/cpp/build/_deps/cccl-src/lib/cmake/libcudacxx/../../../libcudacxx/include/cuda/__stream/get_stream.h:26,
                 from /cudf/cpp/build/_deps/cccl-src/lib/cmake/libcudacxx/../../../libcudacxx/include/cuda/stream_ref:56,
                 from /conda/envs/rapids/include/rmm/cuda_stream_view.hpp:10,
                 from /cudf/cpp/include/cudf/utilities/default_stream.hpp:10,
                 from /cudf/cpp/include/cudf/column/column_view.hpp:8,
                 from /cudf/cpp/include/cudf/column/column.hpp:7,
                 from /cudf/cpp/include/cudf/table/table.hpp:7,
                 from /cudf/cpp/benchmarks/common/generate_nested_types.hpp:8,
                 from /cudf/cpp/benchmarks/merge/merge_structs.cpp:6:
/cudf/cpp/build/_deps/cccl-src/lib/cmake/libcudacxx/../../../libcudacxx/include/cuda/__stream/stream_ref.h:63:3: note: declared here
   63 |   stream_ref() = default;
      |   ^~~~~~~~~~

Introduced by #23769

Checklist

  • I am familiar with the Contributing Guidelines.
  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.

@davidwendt davidwendt self-assigned this Aug 27, 2026
@davidwendt
davidwendt requested a review from a team as a code owner August 27, 2026 13:44
@davidwendt
davidwendt requested review from bdice and qbacpey August 27, 2026 13:44
@davidwendt davidwendt added bug Something isn't working 3 - Ready for Review Ready for review by team libcudf Affects libcudf (C++/CUDA) code. non-breaking Non-breaking change labels Aug 27, 2026
@coderabbitai

coderabbitai Bot commented Aug 27, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 88555e7f-9258-4238-aa35-981f50a99c16

📥 Commits

Reviewing files that changed from the base of the PR and between f54eb2a and 86fc1ba.

📒 Files selected for processing (2)
  • cpp/benchmarks/merge/merge_lists.cpp
  • cpp/benchmarks/merge/merge_structs.cpp

Included review availability: Your plan provides up to 12 included reviews per hour; 11 remain after this review.


📝 Walkthrough

Summary by CodeRabbit

  • Bug Fixes
    • Improved stream handling and synchronization in merge benchmarks for more reliable benchmark execution.

Walkthrough

The merge list and merge struct benchmarks now explicitly use cuda::stream_ref for the default stream and call stream.sync().

Changes

Merge benchmark stream updates

Layer / File(s) Summary
Default stream and synchronization updates
cpp/benchmarks/merge/merge_lists.cpp, cpp/benchmarks/merge/merge_structs.cpp
Both benchmarks declare the default stream as cuda::stream_ref and use stream.sync() for synchronization.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Merge Risk: ⚪ Minimal · up to 86fc1

This localized benchmark-only change removes a deprecation warning without introducing an actionable merge-blocking risk; it is merge-ready after normal checks and review.

Suggested reviewers: qbacpey, vyasr

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main change: fixing a deprecation warning caused by the default construction of cuda::stream_ref in the merge benchmarks.
Description check ✅ Passed The description directly explains the deprecation warning, identifies the affected benchmark files, and describes the stream declaration fix.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

Comment thread cpp/benchmarks/merge/merge_lists.cpp Outdated
void nvbench_merge_list(nvbench::state& state)
{
cuda::stream_ref stream;
auto stream = cudf::get_default_stream();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to fix this so cudf::get_default_stream() returns a cuda::stream_ref. Otherwise we'll be going backwards in our efforts to move away from rmm::cuda_stream_view here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That seems like an ongoing change that would eventually fix this code. Can we merge this until then perhaps?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've made a change here that should be valid even after the cudf::get_default_stream() is updated.

@mhaseeb123 mhaseeb123 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good aside from discussion with @bdice, I am fine either way :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3 - Ready for Review Ready for review by team bug Something isn't working libcudf Affects libcudf (C++/CUDA) code. non-breaking Non-breaking change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants