Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
d11a8bb
Port column wrappers to accept memory_resources and stream
nirandaperera Aug 7, 2026
3f518af
fix wrapper tests
nirandaperera Aug 7, 2026
cb35fb0
fix col util tests
nirandaperera Aug 7, 2026
4a02ab8
fix ctrs
nirandaperera Aug 10, 2026
4d2d6b8
Merge branch 'main' of github.com:rapidsai/cudf into test-column-wrap…
nirandaperera Aug 10, 2026
8479c3d
precommit
nirandaperera Aug 10, 2026
20eddfd
remove defaults
nirandaperera Aug 10, 2026
2e4d5a8
code rabbit suggestions
nirandaperera Aug 10, 2026
32b153d
addng failing default mr
nirandaperera Aug 10, 2026
3cab3a6
fix ctr
nirandaperera Aug 10, 2026
b839630
Merge branch 'main' of github.com:rapidsai/cudf into test-column-wrap…
nirandaperera Aug 10, 2026
19857eb
fix test with todo
nirandaperera Aug 11, 2026
877ffc3
Merge branch 'main' of github.com:rapidsai/cudf into test-column-wrap…
nirandaperera Aug 11, 2026
cd3466f
simplify empty ctrs
nirandaperera Aug 11, 2026
e3cc3db
rename util
nirandaperera Aug 12, 2026
40155c3
Apply suggestion from @bdice
nirandaperera Aug 12, 2026
f4293ad
moving base fixture & use concepts
nirandaperera Aug 12, 2026
25e3b24
Merge branch 'test-column-wrappers-mr' of github.com:nirandaperera/cu…
nirandaperera Aug 12, 2026
e701a38
Merge branch 'main' of github.com:NVIDIA/cudf into test-column-wrappe…
nirandaperera Aug 12, 2026
1a5fa38
precommit
nirandaperera Aug 12, 2026
aa0742e
Merge branch 'main' into test-column-wrappers-mr
bdice Aug 13, 2026
58544b7
addressing bdice concerns
nirandaperera Aug 13, 2026
00ef7bd
Merge branch 'test-column-wrappers-mr' of github.com:nirandaperera/cu…
nirandaperera Aug 13, 2026
c7a70e3
Merge branch 'main' into test-column-wrappers-mr
nirandaperera Aug 14, 2026
47c4eb4
trigger build
nirandaperera Aug 14, 2026
128c1c9
Merge branch 'test-column-wrappers-mr' of github.com:nirandaperera/cu…
nirandaperera Aug 14, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
825 changes: 603 additions & 222 deletions cpp/include/cudf_test/column_wrapper.hpp

Large diffs are not rendered by default.

24 changes: 22 additions & 2 deletions cpp/include/cudf_test/memory_resource_utilities.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

#pragma once

#include <cudf_test/column_wrapper.hpp>
#include <cudf_test/cudf_gtest.hpp>
#include <cudf_test/default_stream.hpp>

Expand All @@ -17,6 +18,7 @@
#include <cuda/memory_resource>
#include <cuda/stream_ref>

#include <concepts>
#include <cstddef>
#include <functional>
#include <utility>
Expand Down Expand Up @@ -154,6 +156,24 @@ class memory_resource_test_harness {
rmm::mr::callback_memory_resource _failing_mr;
};

/**
* @brief Callable that accepts a statistics resource and returns a column wrapper.
*/
template <typename Factory>
concept column_wrapper_statistics_resource_factory =
requires(Factory& factory, rmm::mr::statistics_resource_adaptor& mr) {
{ std::invoke(factory, mr) } -> std::derived_from<detail::column_wrapper>;
};

/**
* @brief Callable that accepts `cudf::memory_resources` and returns a column wrapper.
*/
template <typename Factory>
concept column_wrapper_memory_resources_factory =
requires(Factory& factory, cudf::memory_resources mr) {
{ std::invoke(factory, mr) } -> std::derived_from<detail::column_wrapper>;
};

/**
* @brief Verify that an owning result uses one explicitly supplied output resource.
*
Expand All @@ -169,7 +189,7 @@ class memory_resource_test_harness {
* @param output_expectation Expected relationship between live and total output bytes
* @param stream Stream to synchronize before inspecting allocation counters
*/
template <typename Factory>
template <column_wrapper_statistics_resource_factory Factory>
void expect_output_uses_resource(
Factory&& factory,
output_allocation_expectation output_expectation = output_allocation_expectation::EXACT,
Expand Down Expand Up @@ -207,7 +227,7 @@ void expect_output_uses_resource(
* @param expectations Expected output and temporary allocation behavior
* @param stream Stream to synchronize before inspecting allocation counters
*/
template <typename Factory>
template <column_wrapper_memory_resources_factory Factory>
void expect_output_uses_distinct_resources(
Factory&& factory,
memory_resource_expectations expectations = {},
Expand Down
18 changes: 12 additions & 6 deletions cpp/include/cudf_test/timestamp_utilities.cuh
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
/*
* SPDX-FileCopyrightText: Copyright (c) 2019-2024, NVIDIA CORPORATION.
* SPDX-FileCopyrightText: Copyright (c) 2019-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
* SPDX-License-Identifier: Apache-2.0
*/

#pragma once

#include <cudf_test/column_wrapper.hpp>
#include <cudf_test/default_stream.hpp>

#include <cudf/detail/iterator.cuh>
#include <cudf/utilities/export.hpp>
Expand All @@ -32,11 +33,16 @@ using time_point_ms =
* @param count The number of timestamps to create
* @param start The first timestamp as a cuda::std::chrono::time_point
* @param stop The last timestamp as a cuda::std::chrono::time_point
* @param stream CUDA stream used for device memory operations
* @param mr Memory resources used to allocate the returned column
*/
template <typename T, bool nullable = false>
inline cudf::test::fixed_width_column_wrapper<T, int64_t> generate_timestamps(int32_t count,
time_point_ms start,
time_point_ms stop)
inline cudf::test::fixed_width_column_wrapper<T, int64_t> generate_timestamps(
int32_t count,
time_point_ms start,
time_point_ms stop,
rmm::cuda_stream_view stream = cudf::test::get_default_stream(),
cudf::memory_resources mr = cudf::get_current_device_resource_ref())
{
using Rep = typename T::rep;
using Period = typename T::period;
Expand All @@ -57,10 +63,10 @@ inline cudf::test::fixed_width_column_wrapper<T, int64_t> generate_timestamps(in
if (nullable) {
auto mask =
cudf::detail::make_counting_transform_iterator(0, [](auto i) { return i % 2 == 0; });
return cudf::test::fixed_width_column_wrapper<T, int64_t>(iter, iter + count, mask);
return cudf::test::fixed_width_column_wrapper<T, int64_t>(iter, iter + count, mask, stream, mr);
} else {
// This needs to be in an else to quash `statement_not_reachable` warnings
return cudf::test::fixed_width_column_wrapper<T, int64_t>(iter, iter + count);
return cudf::test::fixed_width_column_wrapper<T, int64_t>(iter, iter + count, stream, mr);
}
}

Expand Down
5 changes: 3 additions & 2 deletions cpp/tests/utilities/column_utilities.cu
Original file line number Diff line number Diff line change
Expand Up @@ -489,8 +489,9 @@ std::string stringify_column_differences(cudf::device_span<int const> difference
buffer << depth_str << "differences:" << std::endl;

auto source_table = cudf::table_view({lhs, rhs});
auto diff_column =
fixed_width_column_wrapper<int32_t>(h_differences.begin(), h_differences.end());
// Intermediate gather indices — allocate on temporary, not output.
Comment thread
nirandaperera marked this conversation as resolved.
Resolved
auto diff_column = fixed_width_column_wrapper<int32_t>(
h_differences.begin(), h_differences.end(), stream, mr.get_temporary_mr());
auto diff_table = cudf::gather(source_table,
diff_column,
cudf::out_of_bounds_policy::DONT_CHECK,
Expand Down
Loading
Loading