Skip to content

Commit

Permalink
Correct member initialization order (#2254)
Browse files Browse the repository at this point in the history
The init order of class members needs to follow the order listed in the class. This corrects the error for the cagra index type, as it was found to be wrong via rapidsai/cuvs#66

Authors:
  - Robert Maynard (https://github.com/robertmaynard)

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

URL: #2254
  • Loading branch information
robertmaynard authored Apr 10, 2024
1 parent 139bfd9 commit 316a065
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions cpp/include/raft/neighbors/cagra_types.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,8 @@ struct index : ann::index {
raft::distance::DistanceType metric = raft::distance::DistanceType::L2Expanded)
: ann::index(),
metric_(metric),
dataset_(new neighbors::empty_dataset<int64_t>(0)),
graph_(make_device_matrix<IdxT, int64_t>(res, 0, 0))
graph_(make_device_matrix<IdxT, int64_t>(res, 0, 0)),
dataset_(new neighbors::empty_dataset<int64_t>(0))
{
}

Expand Down Expand Up @@ -271,8 +271,8 @@ struct index : ann::index {
mdspan<const IdxT, matrix_extent<int64_t>, row_major, graph_accessor> knn_graph)
: ann::index(),
metric_(metric),
dataset_(make_aligned_dataset(res, dataset, 16)),
graph_(make_device_matrix<IdxT, int64_t>(res, 0, 0))
graph_(make_device_matrix<IdxT, int64_t>(res, 0, 0)),
dataset_(make_aligned_dataset(res, dataset, 16))
{
RAFT_EXPECTS(dataset.extent(0) == knn_graph.extent(0),
"Dataset and knn_graph must have equal number of rows");
Expand Down

0 comments on commit 316a065

Please sign in to comment.