|
5 | 5 |
|
6 | 6 | #pragma once |
7 | 7 |
|
| 8 | +#include "detail/ann_utils.cuh" |
8 | 9 | #include "detail/cagra/add_nodes.cuh" |
9 | 10 | #include "detail/cagra/cagra_build.cuh" |
10 | 11 | #include "detail/cagra/cagra_merge.cuh" |
11 | 12 | #include "detail/cagra/cagra_search.cuh" |
12 | 13 | #include "detail/cagra/graph_core.cuh" |
13 | 14 |
|
14 | | -#include "detail/ann_utils.cuh" |
15 | 15 | #include <raft/core/device_mdspan.hpp> |
16 | 16 | #include <raft/core/host_device_accessor.hpp> |
| 17 | +#include <raft/core/logger.hpp> |
17 | 18 | #include <raft/core/mdspan.hpp> |
18 | 19 | #include <raft/core/resources.hpp> |
19 | 20 | #include <raft/linalg/norm.cuh> |
|
22 | 23 | #include <cuvs/core/bitset.hpp> |
23 | 24 | #include <cuvs/distance/distance.hpp> |
24 | 25 | #include <cuvs/neighbors/cagra.hpp> |
25 | | - |
26 | 26 | #include <cuvs/neighbors/common.hpp> |
| 27 | + |
27 | 28 | #include <rmm/cuda_stream_view.hpp> |
28 | 29 |
|
29 | 30 | #include <algorithm> |
30 | | -#include <memory> |
31 | 31 | #include <optional> |
32 | 32 | #include <type_traits> |
33 | 33 |
|
@@ -573,11 +573,16 @@ auto update_dataset(raft::resources const& res, |
573 | 573 | index<T, IdxT, SrcDatasetViewT>&& cagra_index, |
574 | 574 | DstDatasetViewT dataset) -> index<T, IdxT, DstDatasetViewT> |
575 | 575 | { |
576 | | - if constexpr (!std::is_same_v<SrcDatasetViewT, DstDatasetViewT>) { |
577 | | - RAFT_EXPECTS(dataset.n_rows() == static_cast<int64_t>(cagra_index.size()), |
578 | | - "The new dataset row count must match the source dataset row count"); |
579 | | - RAFT_EXPECTS(cagra_index.dim() == 0 || dataset.dim() == cagra_index.dim(), |
580 | | - "The new dataset dimension must match the source dataset dimension"); |
| 576 | + auto const graph_rows = static_cast<int64_t>(cagra_index.graph_size()); |
| 577 | + if (dataset.n_rows() != graph_rows) { |
| 578 | + RAFT_LOG_WARN("The new dataset row count (%ld) does not match the graph row count (%ld)", |
| 579 | + static_cast<long>(dataset.n_rows()), |
| 580 | + static_cast<long>(graph_rows)); |
| 581 | + } |
| 582 | + if (dataset.dim() != cagra_index.dim()) { |
| 583 | + RAFT_LOG_WARN("The new dataset dimension (%u) does not match the index dimension (%u)", |
| 584 | + static_cast<unsigned>(dataset.dim()), |
| 585 | + static_cast<unsigned>(cagra_index.dim())); |
581 | 586 | } |
582 | 587 |
|
583 | 588 | index<T, IdxT, DstDatasetViewT> new_index(res, std::move(cagra_index), dataset); |
|
0 commit comments