From 59bc6bd3f71357694c1113e3e634a40dac69e7f4 Mon Sep 17 00:00:00 2001 From: Tamas Bela Feher Date: Thu, 3 Oct 2024 05:09:08 +0200 Subject: [PATCH] Use 64 bit types for dataset size calculation in CAGRA graph optimizer (#380) This PR fixes #375. Authors: - Tamas Bela Feher (https://github.com/tfeher) Approvers: - Corey J. Nolet (https://github.com/cjnolet) URL: https://github.com/rapidsai/cuvs/pull/380 --- cpp/src/neighbors/detail/cagra/graph_core.cuh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cpp/src/neighbors/detail/cagra/graph_core.cuh b/cpp/src/neighbors/detail/cagra/graph_core.cuh index 9edbbf5c1..43bf1ba2b 100644 --- a/cpp/src/neighbors/detail/cagra/graph_core.cuh +++ b/cpp/src/neighbors/detail/cagra/graph_core.cuh @@ -475,12 +475,12 @@ void sort_knn_graph( { RAFT_EXPECTS(dataset.extent(0) == knn_graph.extent(0), "dataset size is expected to have the same number of graph index size"); - const uint32_t dataset_size = dataset.extent(0); - const uint32_t dataset_dim = dataset.extent(1); + const uint64_t dataset_size = dataset.extent(0); + const uint64_t dataset_dim = dataset.extent(1); const DataT* dataset_ptr = dataset.data_handle(); const IdxT graph_size = dataset_size; - const uint32_t input_graph_degree = knn_graph.extent(1); + const uint64_t input_graph_degree = knn_graph.extent(1); IdxT* const input_graph_ptr = knn_graph.data_handle(); auto large_tmp_mr = raft::resource::get_large_workspace_resource(res); @@ -528,7 +528,7 @@ void sort_knn_graph( kernel_sort = kern_sort; } else { RAFT_FAIL( - "The degree of input knn graph is too large (%u). " + "The degree of input knn graph is too large (%lu). " "It must be equal to or smaller than %d.", input_graph_degree, 1024);