From 316a06583717c0228a9cc66557c5bed16332365d Mon Sep 17 00:00:00 2001 From: Robert Maynard Date: Wed, 10 Apr 2024 14:22:34 -0400 Subject: [PATCH] Correct member initialization order (#2254) 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 https://github.com/rapidsai/cuvs/pull/66 Authors: - Robert Maynard (https://github.com/robertmaynard) Approvers: - Corey J. Nolet (https://github.com/cjnolet) URL: https://github.com/rapidsai/raft/pull/2254 --- cpp/include/raft/neighbors/cagra_types.hpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cpp/include/raft/neighbors/cagra_types.hpp b/cpp/include/raft/neighbors/cagra_types.hpp index 807f89fd65..97c9c0d098 100644 --- a/cpp/include/raft/neighbors/cagra_types.hpp +++ b/cpp/include/raft/neighbors/cagra_types.hpp @@ -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(0)), - graph_(make_device_matrix(res, 0, 0)) + graph_(make_device_matrix(res, 0, 0)), + dataset_(new neighbors::empty_dataset(0)) { } @@ -271,8 +271,8 @@ struct index : ann::index { mdspan, row_major, graph_accessor> knn_graph) : ann::index(), metric_(metric), - dataset_(make_aligned_dataset(res, dataset, 16)), - graph_(make_device_matrix(res, 0, 0)) + graph_(make_device_matrix(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");