Skip to content
2 changes: 1 addition & 1 deletion cpp/include/cudf/detail/utilities/cuda.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include <cudf/types.hpp>
#include <cudf/utilities/error.hpp>

#include <cuda/stream_ref>
#include <cuda/stream>

#include <algorithm>

Expand Down
2 changes: 1 addition & 1 deletion cpp/include/cudf/detail/utilities/stream_pool.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

#include <cudf/utilities/export.hpp>

#include <cuda/stream_ref>
#include <cuda/stream>

#include <cstddef>
#include <span>
Expand Down
16 changes: 8 additions & 8 deletions cpp/include/cudf_test/debug_utilities.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include <cudf/utilities/export.hpp>
#include <cudf/utilities/memory_resource.hpp>

#include <rmm/cuda_stream_view.hpp>
#include <cuda/stream>

namespace CUDF_EXPORT cudf {
namespace test {
Expand All @@ -27,8 +27,8 @@ namespace test {
*/
std::string to_string(cudf::column_view const& col,
std::string const& delimiter,
rmm::cuda_stream_view stream = cudf::test::get_default_stream(),
cudf::memory_resources mr = cudf::get_current_device_resource_ref());
cuda::stream_ref stream = cudf::test::get_default_stream(),
cudf::memory_resources mr = cudf::get_current_device_resource_ref());

/**
* @brief Convert column values to a host vector of strings
Expand All @@ -39,8 +39,8 @@ std::string to_string(cudf::column_view const& col,
*/
std::vector<std::string> to_strings(
cudf::column_view const& col,
rmm::cuda_stream_view stream = cudf::test::get_default_stream(),
cudf::memory_resources mr = cudf::get_current_device_resource_ref());
cuda::stream_ref stream = cudf::test::get_default_stream(),
cudf::memory_resources mr = cudf::get_current_device_resource_ref());

/**
* @brief Print a column view to an ostream
Expand All @@ -51,9 +51,9 @@ std::vector<std::string> to_strings(
* @param mr Memory resources used for temporary device allocations
*/
void print(cudf::column_view const& col,
std::ostream& os = std::cout,
rmm::cuda_stream_view stream = cudf::test::get_default_stream(),
cudf::memory_resources mr = cudf::get_current_device_resource_ref());
std::ostream& os = std::cout,
cuda::stream_ref stream = cudf::test::get_default_stream(),
cudf::memory_resources mr = cudf::get_current_device_resource_ref());

} // namespace test
} // namespace CUDF_EXPORT cudf
6 changes: 3 additions & 3 deletions cpp/include/cudf_test/default_stream.hpp
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
/*
* SPDX-FileCopyrightText: Copyright (c) 2022-2024, NVIDIA CORPORATION.
* SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
* SPDX-License-Identifier: Apache-2.0
*/

#pragma once

#include <cudf/utilities/export.hpp>

#include <rmm/cuda_stream_view.hpp>
#include <cuda/stream>

namespace CUDF_EXPORT cudf {
namespace test {
Expand All @@ -26,7 +26,7 @@ namespace test {
*
* @return The default stream to use for tests.
*/
rmm::cuda_stream_view const get_default_stream();
cuda::stream_ref const get_default_stream();

} // namespace test
} // namespace CUDF_EXPORT cudf
7 changes: 3 additions & 4 deletions cpp/include/cudf_test/print_utilities.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@
#include <cudf/utilities/export.hpp>
#include <cudf/utilities/traits.hpp>

#include <rmm/cuda_stream_view.hpp>

#include <cuda/iterator>
#include <cuda/stream>

#include <iterator>
#include <type_traits>
Expand Down Expand Up @@ -115,7 +114,7 @@ CUDF_KERNEL void print_array_kernel(std::size_t count, int32_t width, char delim
* @param args List of iterators to be printed
*/
template <typename... Ts>
void print_array(std::size_t count, rmm::cuda_stream_view stream, Ts... args)
void print_array(std::size_t count, cuda::stream_ref stream, Ts... args)
{
// The width to pad printed numbers to
constexpr int32_t width = 6;
Expand All @@ -125,7 +124,7 @@ void print_array(std::size_t count, rmm::cuda_stream_view stream, Ts... args)

// TODO we want this to compile to nothing dependnig on compiler flag, rather than runtime
if (std::getenv("CUDA_DBG_DUMP") != nullptr) {
detail::print_array_kernel<<<1, 1, 0, stream.value()>>>(count, width, delimiter, args...);
detail::print_array_kernel<<<1, 1, 0, stream.get()>>>(count, width, delimiter, args...);
}
}

Expand Down
11 changes: 5 additions & 6 deletions cpp/include/cudf_test/stream_checking_resource_adaptor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
#include <cudf/utilities/memory_resource.hpp>

#include <rmm/aligned.hpp>
#include <rmm/cuda_stream_view.hpp>
#include <rmm/resource_ref.hpp>

#include <cuda/memory_resource>
Expand Down Expand Up @@ -76,7 +75,7 @@ class stream_checking_resource_adaptor final {
std::size_t bytes,
std::size_t alignment = rmm::CUDA_ALLOCATION_ALIGNMENT)
{
verify_stream(rmm::cuda_stream_view{stream.get()});
verify_stream(cuda::stream_ref{stream.get()});
return upstream_.allocate(stream, bytes, alignment);
}

Expand All @@ -85,7 +84,7 @@ class stream_checking_resource_adaptor final {
std::size_t bytes,
std::size_t alignment = rmm::CUDA_ALLOCATION_ALIGNMENT) noexcept
{
verify_stream(rmm::cuda_stream_view{stream.get()});
verify_stream(cuda::stream_ref{stream.get()});
upstream_.deallocate(stream, ptr, bytes, alignment);
}

Expand Down Expand Up @@ -116,13 +115,13 @@ class stream_checking_resource_adaptor final {
*
* @throws `std::runtime_error` if provided an invalid stream
*/
void verify_stream(rmm::cuda_stream_view const stream) const
void verify_stream(cuda::stream_ref const stream) const
{
auto cstream{stream.value()};
auto cstream{stream.get()};
auto const invalid_stream =
check_default_stream_ ? ((cstream == cudaStreamDefault) || (cstream == cudaStreamLegacy) ||
(cstream == cudaStreamPerThread))
: (cstream != cudf::test::get_default_stream().value());
: (cstream != cudf::test::get_default_stream().get());

if (invalid_stream) {
if (error_on_invalid_stream_) {
Expand Down
8 changes: 4 additions & 4 deletions cpp/include/cudf_test/table_utilities.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include <cudf/utilities/export.hpp>
#include <cudf/utilities/memory_resource.hpp>

#include <rmm/cuda_stream_view.hpp>
#include <cuda/stream>

namespace CUDF_EXPORT cudf {
namespace test::detail {
Expand Down Expand Up @@ -41,8 +41,8 @@ void expect_table_properties_equal(cudf::table_view lhs, cudf::table_view rhs);
*/
void expect_tables_equal(cudf::table_view lhs,
cudf::table_view rhs,
rmm::cuda_stream_view stream = cudf::test::get_default_stream(),
cudf::memory_resources mr = cudf::get_current_device_resource_ref());
cuda::stream_ref stream = cudf::test::get_default_stream(),
cudf::memory_resources mr = cudf::get_current_device_resource_ref());

/**
* @brief Verifies the equivalency of two tables.
Expand All @@ -60,7 +60,7 @@ void expect_tables_equal(cudf::table_view lhs,
*/
void expect_tables_equivalent(cudf::table_view lhs,
cudf::table_view rhs,
rmm::cuda_stream_view stream = cudf::test::get_default_stream(),
cuda::stream_ref stream = cudf::test::get_default_stream(),
cudf::memory_resources mr = cudf::get_current_device_resource_ref());

} // namespace test::detail
Expand Down
4 changes: 2 additions & 2 deletions cpp/include/cudf_test/testing_main.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: Copyright (c) 2020-2026, NVIDIA CORPORATION.
* SPDX-FileCopyrightText: Copyright (c) 2020-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
* SPDX-License-Identifier: Apache-2.0
*/

Expand All @@ -15,7 +15,6 @@
#include <cudf/utilities/memory_resource.hpp>

#include <rmm/aligned.hpp>
#include <rmm/cuda_stream_view.hpp>
#include <rmm/mr/arena_memory_resource.hpp>
#include <rmm/mr/binning_memory_resource.hpp>
#include <rmm/mr/cuda_async_memory_resource.hpp>
Expand All @@ -28,6 +27,7 @@
#include <rmm/resource_ref.hpp>

#include <cuda/memory_resource>
#include <cuda/stream>

#include <iostream>

Expand Down
4 changes: 2 additions & 2 deletions cpp/tests/ast/transform_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ struct executor_ast {
static std::unique_ptr<cudf::column> compute_column(
cudf::table_view const& table,
cudf::ast::expression const& expr,
rmm::cuda_stream_view stream = cudf::get_default_stream(),
cuda::stream_ref stream = cudf::get_default_stream(),
rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref())
{
return cudf::compute_column(table, expr, stream, mr);
Expand All @@ -60,7 +60,7 @@ struct executor_jit {
static std::unique_ptr<cudf::column> compute_column(
cudf::table_view const& table,
cudf::ast::expression const& expr,
rmm::cuda_stream_view stream = cudf::get_default_stream(),
cuda::stream_ref stream = cudf::get_default_stream(),
rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref())
{
return cudf::compute_column_jit(table, expr, stream, mr);
Expand Down
1 change: 0 additions & 1 deletion cpp/tests/bitmask/bitmask_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
#include <rmm/device_uvector.hpp>

#include <cuda/iterator>
#include <cuda/stream>

#include <stdexcept>

Expand Down
21 changes: 11 additions & 10 deletions cpp/tests/interop/from_arrow_device_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include <cudf/types.hpp>

#include <cuda/iterator>
#include <cuda/stream>

#include <limits>
#include <numeric>
Expand Down Expand Up @@ -791,22 +792,22 @@ TEST_F(FromArrowDeviceTest, StringViewType)
NANOARROW_THROW_NOT_OK(ArrowArrayViewInitFromSchema(&view, &schema, nullptr));
NANOARROW_THROW_NOT_OK(ArrowArrayViewSetArray(&view, &input, nullptr));

auto stream = cudf::get_default_stream();
auto items = view.buffer_views[1].data.as_binary_view;
auto d_items = rmm::device_uvector<ArrowBinaryView>(input.length, stream);
cuda::stream_ref stream = cudf::get_default_stream();
auto items = view.buffer_views[1].data.as_binary_view;
auto d_items = rmm::device_uvector<ArrowBinaryView>(input.length, stream);
CUDF_CUDA_TRY(cudaMemcpyAsync(d_items.data(),
items,
input.length * sizeof(ArrowBinaryView),
cudaMemcpyDefault,
stream.value()));
stream.get()));
auto variadics = std::vector<rmm::device_buffer>();
auto variadic_ptrs = std::vector<char*>();
for (auto i = 0L; i < view.n_variadic_buffers; ++i) {
variadics.emplace_back(view.variadic_buffers[i], view.variadic_buffer_sizes[i], stream);
variadic_ptrs.push_back(static_cast<char*>(variadics.back().data()));
}

stream.synchronize();
stream.sync();

NANOARROW_THROW_NOT_OK(ArrowSchemaSetTypeStruct(&schema, 1));
NANOARROW_THROW_NOT_OK(ArrowSchemaInitFromType(schema.children[0], NANOARROW_TYPE_STRING_VIEW));
Expand Down Expand Up @@ -893,21 +894,21 @@ TEST_F(FromArrowDeviceTest, StringViewTypeWithProducerOwnedPrivateData)
NANOARROW_THROW_NOT_OK(ArrowArrayViewSetArray(&view, input.get(), nullptr));
ASSERT_GT(view.n_variadic_buffers, 0);

auto stream = cudf::get_default_stream();
auto items = view.buffer_views[1].data.as_binary_view;
auto d_items = rmm::device_uvector<ArrowBinaryView>(input->length, stream);
cuda::stream_ref stream = cudf::get_default_stream();
auto items = view.buffer_views[1].data.as_binary_view;
auto d_items = rmm::device_uvector<ArrowBinaryView>(input->length, stream);
CUDF_CUDA_TRY(cudaMemcpyAsync(d_items.data(),
items,
input->length * sizeof(ArrowBinaryView),
cudaMemcpyDefault,
stream.value()));
stream.get()));
auto variadics = std::vector<rmm::device_buffer>();
auto variadic_ptrs = std::vector<char*>();
for (auto i = 0L; i < view.n_variadic_buffers; ++i) {
variadics.emplace_back(view.variadic_buffers[i], view.variadic_buffer_sizes[i], stream);
variadic_ptrs.push_back(static_cast<char*>(variadics.back().data()));
}
stream.synchronize();
stream.sync();

auto variadic_sizes = std::vector<int64_t>();
for (auto i = 0L; i < view.n_variadic_buffers; ++i) {
Expand Down
2 changes: 1 addition & 1 deletion cpp/tests/io/experimental/variant_extract_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2418,7 +2418,7 @@ TEST_F(CastVariantStatusTest, SqlNullInputProducesRowNullStatus)
// Mask row 1 SQL null
auto null_mask = cudf::create_null_mask(2, cudf::mask_state::ALL_VALID, stream, cmr());
cudf::set_null_mask(static_cast<cudf::bitmask_type*>(null_mask.data()), 1, 2, false);
stream.synchronize();
stream.sync();
values_col->set_null_mask(std::move(null_mask), 1);

auto status = make_status_buffer(values_col->size());
Expand Down
6 changes: 3 additions & 3 deletions cpp/tests/io/json/json_quote_normalization_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ void run_test(std::string const& host_input,
{
auto stream_view = cudf::test::get_default_stream();
auto device_input = rmm::device_buffer(host_input.c_str(), host_input.size(), stream_view);
stream_view.synchronize();
stream_view.sync();

// Preprocessing FST
cudf::io::datasource::owning_buffer<rmm::device_buffer> device_data(std::move(device_input));
Expand All @@ -39,8 +39,8 @@ void run_test(std::string const& host_input,
device_data.data(),
preprocessed_host_output.size(),
cudaMemcpyDefault,
stream_view.value()))
stream_view.synchronize();
stream_view.get()))
stream_view.sync();
CUDF_TEST_EXPECT_VECTOR_EQUAL(
preprocessed_host_output, expected_host_output, preprocessed_host_output.size());
}
Expand Down
2 changes: 1 addition & 1 deletion cpp/tests/iterator/iterator_tests.cuh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: Copyright (c) 2019-2026, NVIDIA CORPORATION.
* SPDX-FileCopyrightText: Copyright (c) 2019-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
* SPDX-License-Identifier: Apache-2.0
*/
#pragma once
Expand Down
3 changes: 1 addition & 2 deletions cpp/tests/iterator/value_iterator_test_strings.cu
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: Copyright (c) 2020-2026, NVIDIA CORPORATION.
* SPDX-FileCopyrightText: Copyright (c) 2020-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
* SPDX-License-Identifier: Apache-2.0
*/
#include "iterator_tests.cuh"
Expand All @@ -10,7 +10,6 @@
#include <cudf/utilities/memory_resource.hpp>
#include <cudf/utilities/span.hpp>

#include <rmm/cuda_stream_view.hpp>
#include <rmm/device_uvector.hpp>

#include <cuda/iterator>
Expand Down
Loading
Loading