Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ PenaltyBreakTemplateDeclaration: 10
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 200
PointerAlignment: Left
QualifierAlignment: Right
RawStringFormats:
- Language: Cpp
Delimiters:
Expand Down
30 changes: 15 additions & 15 deletions cpp/benchmarks/common/ndsh_data_generator/ndsh_data_generator.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION.
* SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
* SPDX-License-Identifier: Apache-2.0
*/

Expand Down Expand Up @@ -189,11 +189,11 @@ std::unique_ptr<cudf::table> generate_orders_independent(double scale_factor,
// Generate the `o_orderdate` column
auto o_orderdate_ts = [&]() {
auto const o_orderdate_year = generate_random_string_column_from_set(
cudf::host_span<const char* const>(years.data(), years.size()), o_num_rows, stream, mr);
cudf::host_span<char const* const>(years.data(), years.size()), o_num_rows, stream, mr);
auto const o_orderdate_month = generate_random_string_column_from_set(
cudf::host_span<const char* const>(months.data(), months.size()), o_num_rows, stream, mr);
cudf::host_span<char const* const>(months.data(), months.size()), o_num_rows, stream, mr);
auto const o_orderdate_day = generate_random_string_column_from_set(
cudf::host_span<const char* const>(days.data(), days.size()), o_num_rows, stream, mr);
cudf::host_span<char const* const>(days.data(), days.size()), o_num_rows, stream, mr);
auto const o_orderdate_str = cudf::strings::concatenate(
cudf::table_view(
{o_orderdate_year->view(), o_orderdate_month->view(), o_orderdate_day->view()}),
Expand All @@ -212,7 +212,7 @@ std::unique_ptr<cudf::table> generate_orders_independent(double scale_factor,

// Generate the `o_orderpriority` column
auto o_orderpriority = generate_random_string_column_from_set(
cudf::host_span<const char* const>(vocab_priorities.data(), vocab_priorities.size()),
cudf::host_span<char const* const>(vocab_priorities.data(), vocab_priorities.size()),
o_num_rows,
stream,
mr);
Expand Down Expand Up @@ -391,14 +391,14 @@ std::unique_ptr<cudf::table> generate_lineitem_partial(cudf::table_view const& o

// Generate the `l_shipinstruct` column
auto l_shipinstruct = generate_random_string_column_from_set(
cudf::host_span<const char* const>(vocab_instructions.data(), vocab_instructions.size()),
cudf::host_span<char const* const>(vocab_instructions.data(), vocab_instructions.size()),
l_num_rows,
stream,
mr);

// Generate the `l_shipmode` column
auto l_shipmode = generate_random_string_column_from_set(
cudf::host_span<const char* const>(vocab_modes.data(), vocab_modes.size()),
cudf::host_span<char const* const>(vocab_modes.data(), vocab_modes.size()),
l_num_rows,
stream,
mr);
Expand Down Expand Up @@ -591,27 +591,27 @@ std::unique_ptr<cudf::table> generate_part(double scale_factor,
// Generate the `p_name` column
auto p_name = [&]() {
auto const p_name_a = generate_random_string_column_from_set(
cudf::host_span<const char* const>(vocab_p_name.data(), vocab_p_name.size()),
cudf::host_span<char const* const>(vocab_p_name.data(), vocab_p_name.size()),
num_rows,
stream,
mr);
auto const p_name_b = generate_random_string_column_from_set(
cudf::host_span<const char* const>(vocab_p_name.data(), vocab_p_name.size()),
cudf::host_span<char const* const>(vocab_p_name.data(), vocab_p_name.size()),
num_rows,
stream,
mr);
auto const p_name_c = generate_random_string_column_from_set(
cudf::host_span<const char* const>(vocab_p_name.data(), vocab_p_name.size()),
cudf::host_span<char const* const>(vocab_p_name.data(), vocab_p_name.size()),
num_rows,
stream,
mr);
auto const p_name_d = generate_random_string_column_from_set(
cudf::host_span<const char* const>(vocab_p_name.data(), vocab_p_name.size()),
cudf::host_span<char const* const>(vocab_p_name.data(), vocab_p_name.size()),
num_rows,
stream,
mr);
auto const p_name_e = generate_random_string_column_from_set(
cudf::host_span<const char* const>(vocab_p_name.data(), vocab_p_name.size()),
cudf::host_span<char const* const>(vocab_p_name.data(), vocab_p_name.size()),
num_rows,
stream,
mr);
Expand Down Expand Up @@ -659,7 +659,7 @@ std::unique_ptr<cudf::table> generate_part(double scale_factor,

// Generate the `p_type` column
auto p_type = generate_random_string_column_from_set(
cudf::host_span<const char* const>(vocab_types.data(), vocab_types.size()),
cudf::host_span<char const* const>(vocab_types.data(), vocab_types.size()),
num_rows,
stream,
mr);
Expand All @@ -669,7 +669,7 @@ std::unique_ptr<cudf::table> generate_part(double scale_factor,

// Generate the `p_container` column
auto p_container = generate_random_string_column_from_set(
cudf::host_span<const char* const>(vocab_containers.data(), vocab_containers.size()),
cudf::host_span<char const* const>(vocab_containers.data(), vocab_containers.size()),
num_rows,
stream,
mr);
Expand Down Expand Up @@ -871,7 +871,7 @@ std::unique_ptr<cudf::table> generate_customer(double scale_factor,

// Generate the `c_mktsegment` column
auto c_mktsegment = generate_random_string_column_from_set(
cudf::host_span<const char* const>(vocab_segments.data(), vocab_segments.size()),
cudf::host_span<char const* const>(vocab_segments.data(), vocab_segments.size()),
num_rows,
stream,
mr);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION.
* SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
* SPDX-License-Identifier: Apache-2.0
*/

Expand Down Expand Up @@ -58,7 +58,7 @@ struct random_number_generator {

CUDF_HOST_DEVICE random_number_generator(T lower, T upper) : lower(lower), upper(upper) {}

__device__ T operator()(const int64_t idx) const
__device__ T operator()(int64_t const idx) const
{
if constexpr (cudf::is_integral<T>()) {
thrust::default_random_engine engine;
Expand Down Expand Up @@ -171,7 +171,7 @@ std::unique_ptr<cudf::column> generate_repeat_string_column(std::string const& v
}

std::unique_ptr<cudf::column> generate_random_string_column_from_set(
cudf::host_span<const char* const> set,
cudf::host_span<char const* const> set,
cudf::size_type num_rows,
rmm::cuda_stream_view stream,
rmm::device_async_resource_ref mr)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: Copyright (c) 2024-2025, NVIDIA CORPORATION.
* SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
* SPDX-License-Identifier: Apache-2.0
*/

Expand Down Expand Up @@ -109,7 +109,7 @@ std::unique_ptr<cudf::column> generate_repeat_string_column(
* @param mr Device memory resource used to allocate the returned column's device memory
*/
std::unique_ptr<cudf::column> generate_random_string_column_from_set(
cudf::host_span<const char* const> set,
cudf::host_span<char const* const> set,
cudf::size_type num_rows,
rmm::cuda_stream_view stream = cudf::get_default_stream(),
rmm::device_async_resource_ref mr = cudf::get_current_device_resource_ref());
Expand Down
10 changes: 5 additions & 5 deletions cpp/benchmarks/common/nvbench_utilities.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: Copyright (c) 2024, NVIDIA CORPORATION.
* SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
* SPDX-License-Identifier: Apache-2.0
*/

Expand All @@ -13,16 +13,16 @@ void set_throughputs(nvbench::state& state)
{
double avg_cuda_time = state.get_summary("nv/cold/time/gpu/mean").get_float64("value");

if (const auto items = state.get_element_count(); items != 0) {
if (auto const items = state.get_element_count(); items != 0) {
auto& summ = state.add_summary("nv/cold/bw/item_rate");
summ.set_string("name", "Elem/s");
summ.set_string("hint", "item_rate");
summ.set_string("description", "Number of input elements processed per second");
summ.set_float64("value", static_cast<double>(items) / avg_cuda_time);
}

if (const auto bytes = state.get_global_memory_rw_bytes(); bytes != 0) {
const auto avg_used_gmem_bw = static_cast<double>(bytes) / avg_cuda_time;
if (auto const bytes = state.get_global_memory_rw_bytes(); bytes != 0) {
auto const avg_used_gmem_bw = static_cast<double>(bytes) / avg_cuda_time;
{
auto& summ = state.add_summary("nv/cold/bw/global/bytes_per_second");
summ.set_string("name", "GlobalMem BW");
Expand All @@ -34,7 +34,7 @@ void set_throughputs(nvbench::state& state)
}

{
const auto peak_gmem_bw =
auto const peak_gmem_bw =
static_cast<double>(state.get_device()->get_global_memory_bus_bandwidth());

auto& summ = state.add_summary("nv/cold/bw/global/utilization");
Expand Down
4 changes: 2 additions & 2 deletions cpp/benchmarks/groupby/group_nunique.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION.
* SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
* SPDX-License-Identifier: Apache-2.0
*/

Expand Down Expand Up @@ -46,7 +46,7 @@ void bench_groupby_nunique(nvbench::state& state, nvbench::type_list<Type>)
data_profile_builder()
.cardinality(cardinality)
.distribution(cudf::type_to_id<Type>(), distribution_id::UNIFORM, 0, size);
if (const auto null_freq = state.get_float64("null_probability"); null_freq > 0) {
if (auto const null_freq = state.get_float64("null_probability"); null_freq > 0) {
profile.set_null_probability(null_freq);
} else {
profile.set_null_probability(std::nullopt);
Expand Down
6 changes: 3 additions & 3 deletions cpp/benchmarks/io/cuio_common.cpp
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 Down Expand Up @@ -236,7 +236,7 @@ std::pair<bool, bool> parse_cache_dropping_env()
if (env == nullptr) { return {is_drop_cache_enabled, is_file_scope}; }

// Trim leading/trailing whitespace
std::regex const static pattern{R"(^\s+|\s+$)"};
std::regex static const pattern{R"(^\s+|\s+$)"};
auto env_sanitized = std::regex_replace(env, pattern, "");

// Convert to lowercase
Expand Down Expand Up @@ -284,7 +284,7 @@ void drop_page_cache_if_enabled(std::vector<std::string> const& file_paths)
return;
}

for (const auto& path : file_paths) {
for (auto const& path : file_paths) {
if (path.empty()) { continue; }
kvikio::drop_file_page_cache(path);
}
Expand Down
4 changes: 2 additions & 2 deletions cpp/benchmarks/io/parquet/parquet_reader_filter.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION.
* SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
* SPDX-License-Identifier: Apache-2.0
*/

Expand Down Expand Up @@ -211,7 +211,7 @@ void BM_parquet_read_filter(nvbench::state& state)
std::vector<cudf::column_view> table_columns;
table_columns.push_back(filter_column->view());

for (const auto& col : copy_only_cols) {
for (auto const& col : copy_only_cols) {
table_columns.push_back(col->view());
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION.
* SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
* SPDX-License-Identifier: Apache-2.0
*/

Expand Down Expand Up @@ -153,7 +153,7 @@ int main(int argc, char const** argv)
try {
return extract_input_sources(
input_paths, input_multiplier, num_threads, io_source_type, default_stream);
} catch (const std::exception& e) {
} catch (std::exception const& e) {
print_usage();
throw std::runtime_error(e.what());
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION.
* SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
* SPDX-License-Identifier: Apache-2.0
*/

Expand Down Expand Up @@ -179,7 +179,7 @@ int main(int argc, char const** argv)
try {
return extract_input_sources(
input_paths, input_multiplier, num_threads, io_source_type, default_stream);
} catch (const std::exception& e) {
} catch (std::exception const& e) {
print_usage();
throw std::runtime_error(e.what());
}
Expand Down
8 changes: 4 additions & 4 deletions cpp/include/cudf/strings/detail/gather.cuh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: Copyright (c) 2019-2025, NVIDIA CORPORATION.
* SPDX-FileCopyrightText: Copyright (c) 2019-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
* SPDX-License-Identifier: Apache-2.0
*/
#pragma once
Expand Down Expand Up @@ -291,11 +291,11 @@ std::unique_ptr<cudf::column> gather(strings_column_view const& strings,
// Iterator over the character column of input strings to gather
auto in_chars_itr = thrust::make_transform_iterator(
begin,
cuda::proclaim_return_type<const char*>([d_strings = *d_strings] __device__(size_type idx) {
cuda::proclaim_return_type<char const*>([d_strings = *d_strings] __device__(size_type idx) {
if (NullifyOutOfBounds && (idx < 0 || idx >= d_strings.size())) {
return static_cast<const char*>(nullptr);
return static_cast<char const*>(nullptr);
}
if (not d_strings.is_valid(idx)) { return static_cast<const char*>(nullptr); }
if (not d_strings.is_valid(idx)) { return static_cast<char const*>(nullptr); }
return d_strings.element<string_view>(idx).data();
}));

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

Expand Down Expand Up @@ -430,7 +430,7 @@ struct VectorOfArrays {
return 0;
}

static const char* get_last_error(ArrowArrayStream* stream) { return nullptr; }
static char const* get_last_error(ArrowArrayStream* stream) { return nullptr; }

static void release(ArrowArrayStream* stream)
{
Expand Down
10 changes: 5 additions & 5 deletions cpp/libcudf_streaming/benchmarks/bench_partition.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ std::unique_ptr<cudf::table> create_int_table(cudf::size_type num_rows,

static void BM_PartitionAndPack(benchmark::State& state)
{
const std::int64_t local_size = std::int64_t{state.range(1)} * 1000000;
std::int64_t const local_size = std::int64_t{state.range(1)} * 1000000;
int num_rows = int(local_size / std::int64_t{sizeof(std::int32_t)});

const int num_partitions = state.range(1);
int const num_partitions = state.range(1);

rmm::cuda_stream_view stream = rmm::cuda_stream_default;

Expand Down Expand Up @@ -86,9 +86,9 @@ static void BM_PartitionAndPack(benchmark::State& state)

static void BM_PartitionAndPackCurrentImpl(benchmark::State& state)
{
const int nranks = state.range(0);
const std::int64_t local_size = std::int64_t{state.range(1)} * 1000000;
const int num_partitions = state.range(2);
int const nranks = state.range(0);
std::int64_t const local_size = std::int64_t{state.range(1)} * 1000000;
int const num_partitions = state.range(2);

int total_npartitions = nranks * num_partitions;
int num_rows =
Expand Down
2 changes: 1 addition & 1 deletion cpp/libcudf_streaming/benchmarks/bench_shuffle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ rapidsmpf::Duration do_run(rapidsmpf::shuffler::PartID const total_num_partition
// Check the shuffle result (this test only works for non-empty partitions
// thus we only check large shuffles).
if (args.num_local_rows >= 1000000) {
for (const auto& output_partition : output_partitions) {
for (auto const& output_partition : output_partitions) {
auto [parts, owner] =
cudf_streaming::partition_and_split(output_partition->view(),
{0},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ struct device_bloom_filter {
*
* @return A const-qualified bloom filter viewing the underlying storage.
*/
static const device_bloom_filter view(std::size_t num_blocks,
static device_bloom_filter const view(std::size_t num_blocks,
std::uint64_t seed,
void const* storage,
rmm::cuda_stream_view stream);
Expand Down
Loading
Loading