Skip to content

Commit 7353194

Browse files
authored
Fix RMAT docs (#3071)
Authors: - Divye Gala (https://github.com/divyegala) Approvers: - Bradley Dice (https://github.com/bdice) - Corey J. Nolet (https://github.com/cjnolet) URL: #3071
1 parent 2141422 commit 7353194

6 files changed

Lines changed: 19 additions & 19 deletions

File tree

cpp/.clang-format

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ BreakConstructorInitializers: BeforeColon
5656
BreakInheritanceList: BeforeColon
5757
BreakStringLiterals: true
5858
ColumnLimit: 100
59-
CommentPragmas: '^ IWYU pragma:'
59+
CommentPragmas: '^ ?[*]? ?(IWYU pragma:|SPDX-)'
6060
CompactNamespaces: false
6161
ConstructorInitializerAllOnOneLineOrOnePerLine: true
6262
# Kept the below 2 to be the same as `IndentWidth` to keep everything uniform

cpp/include/raft/random/detail/rmat_rectangular_generator.cuh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION.
2+
* SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
33
* SPDX-License-Identifier: Apache-2.0
44
*/
55

@@ -247,7 +247,7 @@ void rmat_rectangular_gen_impl(raft::resources const& handle,
247247
* @brief Overload of `rmat_rectangular_gen` that assumes the same
248248
* a, b, c, d probability distributions across all the scales.
249249
*
250-
* `a`, `b, and `c` effectively replace the above overload's
250+
* `a`, `b`, and `c` effectively replace the above overload's
251251
* `theta` parameter.
252252
*/
253253
template <typename IdxT, typename ProbT>

cpp/include/raft/random/detail/rmat_rectangular_generator_types.cuh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION.
2+
* SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
33
* SPDX-License-Identifier: Apache-2.0
44
*/
55

@@ -39,8 +39,8 @@ namespace detail {
3939
* This class prevents users from doing anything other than that,
4040
* and makes it easier for the three cases to share a common implementation.
4141
* It also prevents duplication of run-time vector length checking
42-
* (`out` must have twice the number of elements as `out_src` and `out_dst`,
43-
* and `out_src` and `out_dst` must have the same length).
42+
* (`out.extent(0)` must equal `out_src.extent(0)` and `out_dst.extent(0)`,
43+
* and `out_src.extent(0)` and `out_dst.extent(0)` must have the same length).
4444
*
4545
* @tparam IdxT Type of each node index; must be integral.
4646
*
@@ -92,11 +92,11 @@ class rmat_rectangular_gen_output {
9292
const out_dst_view_type& dst)
9393
: out_(out), pair_(src, dst)
9494
{
95-
RAFT_EXPECTS(out.extent(0) == IdxT(2) * dst.extent(0),
95+
RAFT_EXPECTS(out.extent(0) == dst.extent(0),
9696
"rmat_rectangular_gen: "
97-
"out.extent(0) = %zu != 2 * out_dst.extent(0) = %zu",
97+
"out.extent(0) = %zu != out_dst.extent(0) = %zu",
9898
static_cast<std::size_t>(out.extent(0)),
99-
static_cast<std::size_t>(IdxT(2) * dst.extent(0)));
99+
static_cast<std::size_t>(dst.extent(0)));
100100
}
101101

102102
out_view_type out_view() const { return out_; }

cpp/include/raft/random/rmat_rectangular_generator.cuh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION.
2+
* SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
33
* SPDX-License-Identifier: Apache-2.0
44
*/
55

@@ -61,7 +61,7 @@ namespace random {
6161
* @param[in] r_scale 2^r_scale represents the number of source nodes
6262
* @param[in] c_scale 2^c_scale represents the number of destination nodes
6363
*
64-
* @pre `out.extent(0) == 2 * `out_src.extent(0)` is `true`
64+
* @pre `out.extent(0) == out_src.extent(0)` is `true`
6565
* @pre `out_src.extent(0) == out_dst.extent(0)` is `true`
6666
*
6767
* We call the `r_scale != c_scale` case the "rectangular adjacency matrix" case
@@ -150,10 +150,10 @@ void rmat_rectangular_gen(
150150
* and `out_src` and `out_dst` with the struct-of-arrays
151151
* output representation).
152152
*
153-
* `a`, `b, and `c` effectively replace the above overloads'
153+
* `a`, `b`, and `c` effectively replace the above overloads'
154154
* `theta` parameter.
155155
*
156-
* @pre `out.extent(0) == 2 * `out_src.extent(0)` is `true`
156+
* @pre `out.extent(0) == out_src.extent(0)` is `true`
157157
* @pre `out_src.extent(0) == out_dst.extent(0)` is `true`
158158
*/
159159
template <typename IdxT, typename ProbT>
@@ -179,7 +179,7 @@ void rmat_rectangular_gen(
179179
* and takes only two output vectors
180180
* (the struct-of-arrays output representation).
181181
*
182-
* `a`, `b, and `c` effectively replace the above overloads'
182+
* `a`, `b`, and `c` effectively replace the above overloads'
183183
* `theta` parameter.
184184
*
185185
* @pre `out_src.extent(0) == out_dst.extent(0)` is `true`
@@ -205,7 +205,7 @@ void rmat_rectangular_gen(raft::resources const& handle,
205205
* and takes only one output vector
206206
* (the array-of-structs output representation).
207207
*
208-
* `a`, `b, and `c` effectively replace the above overloads'
208+
* `a`, `b`, and `c` effectively replace the above overloads'
209209
* `theta` parameter.
210210
*/
211211
template <typename IdxT, typename ProbT>

cpp/tests/random/rmat_rectangular_generator.cu

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION.
2+
* SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
33
* SPDX-License-Identifier: Apache-2.0
44
*/
55

@@ -282,7 +282,7 @@ class RmatGenMdspanTest : public ::testing::TestWithParam<RmatInputs> {
282282
using out_view_type = raft::device_mdspan<index_type,
283283
raft::extents<index_type, raft::dynamic_extent, 2>,
284284
raft::row_major>;
285-
out_view_type out_view(out.data(), out.size());
285+
out_view_type out_view(out.data(), params.n_edges);
286286

287287
using out_src_view_type = raft::device_vector_view<index_type, index_type>;
288288
out_src_view_type out_src_view(out_src.data(), out_src.size());

cpp/tests/sparse/solver/lanczos.cu

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* SPDX-FileCopyrightText: Copyright (c) 2019-2026, NVIDIA CORPORATION.
2+
* SPDX-FileCopyrightText: Copyright (c) 2019-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
33
* SPDX-License-Identifier: Apache-2.0
44
*/
55

@@ -108,7 +108,7 @@ class rmat_lanczos_tests
108108
raft::random::uniform<ValueType>(handle, rng, theta.view(), 0, 1);
109109

110110
auto out = raft::make_device_mdarray<IndexType, IndexType, raft::row_major>(
111-
handle, raft::extents<IndexType, raft::dynamic_extent, 2>(n_edges * 2, 2));
111+
handle, raft::extents<IndexType, raft::dynamic_extent, 2>(n_edges, 2));
112112
auto out_src = raft::make_device_vector<IndexType, IndexType, raft::row_major>(handle, n_edges);
113113
auto out_dst = raft::make_device_vector<IndexType, IndexType, raft::row_major>(handle, n_edges);
114114

0 commit comments

Comments
 (0)