|
1 | 1 | /*
|
2 |
| - * Copyright (c) 2020-2024, NVIDIA CORPORATION. |
| 2 | + * Copyright (c) 2020-2025, NVIDIA CORPORATION. |
3 | 3 | *
|
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License");
|
5 | 5 | * you may not use this file except in compliance with the License.
|
@@ -112,15 +112,16 @@ class partition_t {
|
112 | 112 | }
|
113 | 113 | }
|
114 | 114 |
|
115 |
| - std::vector<vertex_t> const& vertex_partition_range_offsets() const |
| 115 | + raft::host_span<vertex_t const> vertex_partition_range_offsets() const |
116 | 116 | {
|
117 |
| - return vertex_partition_range_offsets_; |
| 117 | + return raft::host_span<vertex_t const>(vertex_partition_range_offsets_.data(), |
| 118 | + vertex_partition_range_offsets_.size()); |
118 | 119 | }
|
119 | 120 |
|
120 |
| - std::vector<vertex_t> vertex_partition_range_lasts() const |
| 121 | + raft::host_span<vertex_t const> vertex_partition_range_lasts() const |
121 | 122 | {
|
122 |
| - return std::vector<vertex_t>(vertex_partition_range_offsets_.begin() + 1, |
123 |
| - vertex_partition_range_offsets_.end()); |
| 123 | + return raft::host_span<vertex_t const>(vertex_partition_range_offsets_.data() + 1, |
| 124 | + vertex_partition_range_offsets_.size() - 1); |
124 | 125 | }
|
125 | 126 |
|
126 | 127 | std::tuple<vertex_t, vertex_t> local_vertex_partition_range() const
|
@@ -395,12 +396,12 @@ class graph_view_t<vertex_t, edge_t, store_transposed, multi_gpu, std::enable_if
|
395 | 396 | edge_partition_dcs_nzd_range_bitmaps,
|
396 | 397 | graph_view_meta_t<vertex_t, edge_t, store_transposed, multi_gpu> meta);
|
397 | 398 |
|
398 |
| - std::vector<vertex_t> vertex_partition_range_offsets() const |
| 399 | + raft::host_span<vertex_t const> vertex_partition_range_offsets() const |
399 | 400 | {
|
400 | 401 | return partition_.vertex_partition_range_offsets();
|
401 | 402 | }
|
402 | 403 |
|
403 |
| - std::vector<vertex_t> vertex_partition_range_lasts() const |
| 404 | + raft::host_span<vertex_t const> vertex_partition_range_lasts() const |
404 | 405 | {
|
405 | 406 | return partition_.vertex_partition_range_lasts();
|
406 | 407 | }
|
@@ -856,15 +857,16 @@ class graph_view_t<vertex_t, edge_t, store_transposed, multi_gpu, std::enable_if
|
856 | 857 | raft::device_span<vertex_t const> indices,
|
857 | 858 | graph_view_meta_t<vertex_t, edge_t, store_transposed, multi_gpu> meta);
|
858 | 859 |
|
859 |
| - std::vector<vertex_t> vertex_partition_range_offsets() const |
| 860 | + raft::host_span<vertex_t const> vertex_partition_range_offsets() const |
860 | 861 | {
|
861 |
| - return std::vector<vertex_t>{local_vertex_partition_range_first(), |
862 |
| - local_vertex_partition_range_last()}; |
| 862 | + return raft::host_span<vertex_t const>(vertex_partition_range_offsets_.data(), |
| 863 | + vertex_partition_range_offsets_.size()); |
863 | 864 | }
|
864 | 865 |
|
865 |
| - std::vector<vertex_t> vertex_partition_range_lasts() const |
| 866 | + raft::host_span<vertex_t const> vertex_partition_range_lasts() const |
866 | 867 | {
|
867 |
| - return std::vector<vertex_t>{local_vertex_partition_range_last()}; |
| 868 | + return raft::host_span<vertex_t const>(vertex_partition_range_offsets_.data() + 1, |
| 869 | + vertex_partition_range_offsets_.size() - 1); |
868 | 870 | }
|
869 | 871 |
|
870 | 872 | std::tuple<vertex_t, vertex_t> local_vertex_partition_range() const
|
@@ -1109,6 +1111,8 @@ class graph_view_t<vertex_t, edge_t, store_transposed, multi_gpu, std::enable_if
|
1109 | 1111 | }
|
1110 | 1112 |
|
1111 | 1113 | private:
|
| 1114 | + std::vector<vertex_t> vertex_partition_range_offsets_{}; // size = 1 + 1 |
| 1115 | + |
1112 | 1116 | raft::device_span<edge_t const> offsets_{};
|
1113 | 1117 | raft::device_span<vertex_t const> indices_{};
|
1114 | 1118 |
|
|
0 commit comments