Skip to content

Commit

Permalink
Use 64 bit types for dataset size calculation in CAGRA graph optimizer (
Browse files Browse the repository at this point in the history
#380)

This PR fixes #375.

Authors:
  - Tamas Bela Feher (https://github.com/tfeher)

Approvers:
  - Corey J. Nolet (https://github.com/cjnolet)

URL: #380
  • Loading branch information
tfeher authored Oct 3, 2024
1 parent d093986 commit 59bc6bd
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions cpp/src/neighbors/detail/cagra/graph_core.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -528,7 +528,7 @@ void sort_knn_graph(
kernel_sort = kern_sort<DataT, IdxT, numElementsPerThread>;
} 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);
Expand Down

0 comments on commit 59bc6bd

Please sign in to comment.