diff --git a/cpp/.clang-format b/cpp/.clang-format index 3d86bfd087..4965d2a2b3 100644 --- a/cpp/.clang-format +++ b/cpp/.clang-format @@ -56,7 +56,7 @@ BreakConstructorInitializers: BeforeColon BreakInheritanceList: BeforeColon BreakStringLiterals: true ColumnLimit: 100 -CommentPragmas: '^ IWYU pragma:' +CommentPragmas: '^ ?[*]? ?(IWYU pragma:|SPDX-)' CompactNamespaces: false ConstructorInitializerAllOnOneLineOrOnePerLine: true # Kept the below 2 to be the same as `IndentWidth` to keep everything uniform diff --git a/cpp/include/raft/random/detail/rmat_rectangular_generator.cuh b/cpp/include/raft/random/detail/rmat_rectangular_generator.cuh index 044ef84171..2dc9754f63 100644 --- a/cpp/include/raft/random/detail/rmat_rectangular_generator.cuh +++ b/cpp/include/raft/random/detail/rmat_rectangular_generator.cuh @@ -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 */ @@ -247,7 +247,7 @@ void rmat_rectangular_gen_impl(raft::resources const& handle, * @brief Overload of `rmat_rectangular_gen` that assumes the same * a, b, c, d probability distributions across all the scales. * - * `a`, `b, and `c` effectively replace the above overload's + * `a`, `b`, and `c` effectively replace the above overload's * `theta` parameter. */ template diff --git a/cpp/include/raft/random/detail/rmat_rectangular_generator_types.cuh b/cpp/include/raft/random/detail/rmat_rectangular_generator_types.cuh index 84b6d7101b..2a7f95c574 100644 --- a/cpp/include/raft/random/detail/rmat_rectangular_generator_types.cuh +++ b/cpp/include/raft/random/detail/rmat_rectangular_generator_types.cuh @@ -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 */ @@ -39,8 +39,8 @@ namespace detail { * This class prevents users from doing anything other than that, * and makes it easier for the three cases to share a common implementation. * It also prevents duplication of run-time vector length checking - * (`out` must have twice the number of elements as `out_src` and `out_dst`, - * and `out_src` and `out_dst` must have the same length). + * (`out.extent(0)` must equal `out_src.extent(0)` and `out_dst.extent(0)`, + * and `out_src.extent(0)` and `out_dst.extent(0)` must have the same length). * * @tparam IdxT Type of each node index; must be integral. * @@ -92,11 +92,11 @@ class rmat_rectangular_gen_output { const out_dst_view_type& dst) : out_(out), pair_(src, dst) { - RAFT_EXPECTS(out.extent(0) == IdxT(2) * dst.extent(0), + RAFT_EXPECTS(out.extent(0) == dst.extent(0), "rmat_rectangular_gen: " - "out.extent(0) = %zu != 2 * out_dst.extent(0) = %zu", + "out.extent(0) = %zu != out_dst.extent(0) = %zu", static_cast(out.extent(0)), - static_cast(IdxT(2) * dst.extent(0))); + static_cast(dst.extent(0))); } out_view_type out_view() const { return out_; } diff --git a/cpp/include/raft/random/rmat_rectangular_generator.cuh b/cpp/include/raft/random/rmat_rectangular_generator.cuh index 9a9070ad8e..8333d693a4 100644 --- a/cpp/include/raft/random/rmat_rectangular_generator.cuh +++ b/cpp/include/raft/random/rmat_rectangular_generator.cuh @@ -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 */ @@ -61,7 +61,7 @@ namespace random { * @param[in] r_scale 2^r_scale represents the number of source nodes * @param[in] c_scale 2^c_scale represents the number of destination nodes * - * @pre `out.extent(0) == 2 * `out_src.extent(0)` is `true` + * @pre `out.extent(0) == out_src.extent(0)` is `true` * @pre `out_src.extent(0) == out_dst.extent(0)` is `true` * * We call the `r_scale != c_scale` case the "rectangular adjacency matrix" case @@ -150,10 +150,10 @@ void rmat_rectangular_gen( * and `out_src` and `out_dst` with the struct-of-arrays * output representation). * - * `a`, `b, and `c` effectively replace the above overloads' + * `a`, `b`, and `c` effectively replace the above overloads' * `theta` parameter. * - * @pre `out.extent(0) == 2 * `out_src.extent(0)` is `true` + * @pre `out.extent(0) == out_src.extent(0)` is `true` * @pre `out_src.extent(0) == out_dst.extent(0)` is `true` */ template @@ -179,7 +179,7 @@ void rmat_rectangular_gen( * and takes only two output vectors * (the struct-of-arrays output representation). * - * `a`, `b, and `c` effectively replace the above overloads' + * `a`, `b`, and `c` effectively replace the above overloads' * `theta` parameter. * * @pre `out_src.extent(0) == out_dst.extent(0)` is `true` @@ -205,7 +205,7 @@ void rmat_rectangular_gen(raft::resources const& handle, * and takes only one output vector * (the array-of-structs output representation). * - * `a`, `b, and `c` effectively replace the above overloads' + * `a`, `b`, and `c` effectively replace the above overloads' * `theta` parameter. */ template diff --git a/cpp/tests/random/rmat_rectangular_generator.cu b/cpp/tests/random/rmat_rectangular_generator.cu index 0f4a3f2372..2eb1b9f23b 100644 --- a/cpp/tests/random/rmat_rectangular_generator.cu +++ b/cpp/tests/random/rmat_rectangular_generator.cu @@ -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 */ @@ -282,7 +282,7 @@ class RmatGenMdspanTest : public ::testing::TestWithParam { using out_view_type = raft::device_mdspan, raft::row_major>; - out_view_type out_view(out.data(), out.size()); + out_view_type out_view(out.data(), params.n_edges); using out_src_view_type = raft::device_vector_view; out_src_view_type out_src_view(out_src.data(), out_src.size()); diff --git a/cpp/tests/sparse/solver/lanczos.cu b/cpp/tests/sparse/solver/lanczos.cu index eaa5ffaa9c..cd10cee71a 100644 --- a/cpp/tests/sparse/solver/lanczos.cu +++ b/cpp/tests/sparse/solver/lanczos.cu @@ -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 */ @@ -108,7 +108,7 @@ class rmat_lanczos_tests raft::random::uniform(handle, rng, theta.view(), 0, 1); auto out = raft::make_device_mdarray( - handle, raft::extents(n_edges * 2, 2)); + handle, raft::extents(n_edges, 2)); auto out_src = raft::make_device_vector(handle, n_edges); auto out_dst = raft::make_device_vector(handle, n_edges);