diff options
author | Håvard Pettersen <havardpe@yahooinc.com> | 2022-11-18 13:54:07 +0000 |
---|---|---|
committer | Håvard Pettersen <havardpe@yahooinc.com> | 2022-11-18 13:54:07 +0000 |
commit | 2368e191d44e8eee5b65b6df7bfd71509ab1b7bb (patch) | |
tree | 91acbf05410cb76d466042354a3f24a38a29c9e0 /searchlib | |
parent | 8bdf68624696be64182e559d61124326bb37a903 (diff) |
make clang happy
Diffstat (limited to 'searchlib')
7 files changed, 27 insertions, 27 deletions
diff --git a/searchlib/src/tests/tensor/hnsw_index/hnsw_index_test.cpp b/searchlib/src/tests/tensor/hnsw_index/hnsw_index_test.cpp index d4415884cd3..1c930a109c5 100644 --- a/searchlib/src/tests/tensor/hnsw_index/hnsw_index_test.cpp +++ b/searchlib/src/tests/tensor/hnsw_index/hnsw_index_test.cpp @@ -466,7 +466,7 @@ TYPED_TEST(HnswIndexTest, memory_is_reclaimed_when_doing_changes_to_graph) this->remove_document(2); size_t node_ref_growth = 0; - if constexpr (this->is_single) { + if constexpr (TestFixture::is_single) { this->expect_level_0(1, {3}); this->expect_empty_level_0(2); this->expect_level_0(3, {1}); @@ -581,8 +581,8 @@ template <class ResultGraph, HnswIndexType type> ResultGraph make_graph_helper(HnswIndex<type>& index) { - using LevelArrayRef = HnswGraph<type>::LevelArrayRef; - using LinkArrayRef = HnswGraph<type>::LinkArrayRef; + using LevelArrayRef = typename HnswGraph<type>::LevelArrayRef; + using LinkArrayRef = typename HnswGraph<type>::LinkArrayRef; auto& graph = index.get_graph(); ResultGraph result(graph.size()); assert(!graph.get_node_ref(0).valid()); diff --git a/searchlib/src/vespa/searchlib/tensor/hnsw_graph.cpp b/searchlib/src/vespa/searchlib/tensor/hnsw_graph.cpp index d21f7387b9c..4be7a3e135c 100644 --- a/searchlib/src/vespa/searchlib/tensor/hnsw_graph.cpp +++ b/searchlib/src/vespa/searchlib/tensor/hnsw_graph.cpp @@ -24,7 +24,7 @@ template <HnswIndexType type> HnswGraph<type>::~HnswGraph() = default; template <HnswIndexType type> -HnswGraph<type>::NodeRef +typename HnswGraph<type>::NodeRef HnswGraph<type>::make_node(uint32_t nodeid, uint32_t docid, uint32_t subspace, uint32_t num_levels) { node_refs.ensure_size(nodeid + 1, NodeType()); @@ -89,7 +89,7 @@ HnswGraph<type>::set_link_array(uint32_t nodeid, uint32_t level, const LinkArray } template <HnswIndexType type> -HnswGraph<type>::Histograms +typename HnswGraph<type>::Histograms HnswGraph<type>::histograms() const { Histograms result; @@ -135,8 +135,8 @@ HnswGraph<type>::set_entry_node(EntryNode node) { entry_nodeid_and_level.store(value, std::memory_order_release); } -template class HnswGraph<HnswIndexType::SINGLE>; -template class HnswGraph<HnswIndexType::MULTI>; +template struct HnswGraph<HnswIndexType::SINGLE>; +template struct HnswGraph<HnswIndexType::MULTI>; } // namespace diff --git a/searchlib/src/vespa/searchlib/tensor/hnsw_graph.h b/searchlib/src/vespa/searchlib/tensor/hnsw_graph.h index 09246792210..5b448ea27b7 100644 --- a/searchlib/src/vespa/searchlib/tensor/hnsw_graph.h +++ b/searchlib/src/vespa/searchlib/tensor/hnsw_graph.h @@ -27,7 +27,7 @@ struct HnswGraph { // This uses 12 bits for buffer id -> 4096 buffers. using LinkArrayEntryRefType = vespalib::datastore::EntryRefT<20>; - using NodeType = HnswIndexTraits<type>::NodeType; + using NodeType = typename HnswIndexTraits<type>::NodeType; // Provides mapping from document id -> node reference. // The reference is used to lookup the node data in NodeStore. diff --git a/searchlib/src/vespa/searchlib/tensor/hnsw_index.cpp b/searchlib/src/vespa/searchlib/tensor/hnsw_index.cpp index 0d63c6291f9..ce9f1ad9ca7 100644 --- a/searchlib/src/vespa/searchlib/tensor/hnsw_index.cpp +++ b/searchlib/src/vespa/searchlib/tensor/hnsw_index.cpp @@ -100,7 +100,7 @@ HnswIndex<type>::have_closer_distance(HnswCandidate candidate, const HnswCandida } template <HnswIndexType type> -HnswIndex<type>::SelectResult +typename HnswIndex<type>::SelectResult HnswIndex<type>::select_neighbors_simple(const HnswCandidateVector& neighbors, uint32_t max_links) const { HnswCandidateVector sorted(neighbors); @@ -117,7 +117,7 @@ HnswIndex<type>::select_neighbors_simple(const HnswCandidateVector& neighbors, u } template <HnswIndexType type> -HnswIndex<type>::SelectResult +typename HnswIndex<type>::SelectResult HnswIndex<type>::select_neighbors_heuristic(const HnswCandidateVector& neighbors, uint32_t max_links) const { SelectResult result; @@ -145,7 +145,7 @@ HnswIndex<type>::select_neighbors_heuristic(const HnswCandidateVector& neighbors } template <HnswIndexType type> -HnswIndex<type>::SelectResult +typename HnswIndex<type>::SelectResult HnswIndex<type>::select_neighbors(const HnswCandidateVector& neighbors, uint32_t max_links) const { if (_cfg.heuristic_select_neighbors()) { @@ -377,7 +377,7 @@ HnswIndex<type>::add_document(uint32_t docid) } template <HnswIndexType type> -HnswIndex<type>::PreparedAddDoc +typename HnswIndex<type>::PreparedAddDoc HnswIndex<type>::internal_prepare_add(uint32_t docid, VectorBundle input_vectors, vespalib::GenerationHandler::Guard read_guard) const { assert(input_vectors.subspaces() == 1); @@ -393,7 +393,7 @@ HnswIndex<type>::internal_prepare_add(uint32_t docid, VectorBundle input_vectors template <HnswIndexType type> void -HnswIndex<type>::internal_prepare_add_node(HnswIndex::PreparedAddDoc& op, TypedCells input_vector, const GraphType::EntryNode& entry) const +HnswIndex<type>::internal_prepare_add_node(typename HnswIndex::PreparedAddDoc& op, TypedCells input_vector, const typename GraphType::EntryNode& entry) const { // TODO: Add capping on num_levels int node_max_level = _level_generator->max_level(); @@ -436,8 +436,8 @@ HnswIndex<type>::internal_prepare_add_node(HnswIndex::PreparedAddDoc& op, TypedC } template <HnswIndexType type> -HnswIndex<type>::LinkArray -HnswIndex<type>::filter_valid_nodeids(uint32_t level, const PreparedAddNode::Links &neighbors, uint32_t self_nodeid) +typename HnswIndex<type>::LinkArray +HnswIndex<type>::filter_valid_nodeids(uint32_t level, const typename PreparedAddNode::Links &neighbors, uint32_t self_nodeid) { LinkArray valid; valid.reserve(neighbors.size()); diff --git a/searchlib/src/vespa/searchlib/tensor/hnsw_index.h b/searchlib/src/vespa/searchlib/tensor/hnsw_index.h index 7807d45baaf..a583f6f885c 100644 --- a/searchlib/src/vespa/searchlib/tensor/hnsw_index.h +++ b/searchlib/src/vespa/searchlib/tensor/hnsw_index.h @@ -67,18 +67,18 @@ public: } } - using IdMapping = HnswIndexTraits<type>::IdMapping; + using IdMapping = typename HnswIndexTraits<type>::IdMapping; protected: using GraphType = HnswGraph<type>; - using NodeType = GraphType::NodeType; + using NodeType = typename GraphType::NodeType; using AtomicEntryRef = vespalib::datastore::AtomicEntryRef; - using NodeStore = GraphType::NodeStore; + using NodeStore = typename GraphType::NodeStore; - using LinkStore = GraphType::LinkStore; - using LinkArrayRef = GraphType::LinkArrayRef; + using LinkStore = typename GraphType::LinkStore; + using LinkArrayRef = typename GraphType::LinkArrayRef; using LinkArray = std::vector<uint32_t, vespalib::allocator_large<uint32_t>>; - using LevelArrayRef = GraphType::LevelArrayRef; + using LevelArrayRef = typename GraphType::LevelArrayRef; using TypedCells = vespalib::eval::TypedCells; @@ -184,8 +184,8 @@ protected: }; PreparedAddDoc internal_prepare_add(uint32_t docid, VectorBundle input_vectors, vespalib::GenerationHandler::Guard read_guard) const; - void internal_prepare_add_node(HnswIndex::PreparedAddDoc& op, TypedCells input_vector, const GraphType::EntryNode& entry) const; - LinkArray filter_valid_nodeids(uint32_t level, const PreparedAddNode::Links &neighbors, uint32_t self_nodeid); + void internal_prepare_add_node(HnswIndex::PreparedAddDoc& op, TypedCells input_vector, const typename GraphType::EntryNode& entry) const; + LinkArray filter_valid_nodeids(uint32_t level, const typename PreparedAddNode::Links &neighbors, uint32_t self_nodeid); void internal_complete_add(uint32_t docid, PreparedAddDoc &op); void internal_complete_add_node(uint32_t nodeid, uint32_t docid, uint32_t subspace, PreparedAddNode &prepared_node); public: diff --git a/searchlib/src/vespa/searchlib/tensor/hnsw_index_saver.h b/searchlib/src/vespa/searchlib/tensor/hnsw_index_saver.h index d632b9230a8..fa1ae6a5ed6 100644 --- a/searchlib/src/vespa/searchlib/tensor/hnsw_index_saver.h +++ b/searchlib/src/vespa/searchlib/tensor/hnsw_index_saver.h @@ -33,7 +33,7 @@ private: MetaData(); ~MetaData(); }; - const HnswGraph<type>::LinkStore &_graph_links; + const typename HnswGraph<type>::LinkStore &_graph_links; MetaData _meta_data; }; diff --git a/searchlib/src/vespa/searchlib/tensor/tensor_attribute_loader.cpp b/searchlib/src/vespa/searchlib/tensor/tensor_attribute_loader.cpp index df732d3ab24..5379246be90 100644 --- a/searchlib/src/vespa/searchlib/tensor/tensor_attribute_loader.cpp +++ b/searchlib/src/vespa/searchlib/tensor/tensor_attribute_loader.cpp @@ -81,12 +81,13 @@ public: ThreadedIndexBuilder(TensorAttribute& attr, vespalib::GenerationHandler& generation_handler, TensorStore& store, NearestNeighborIndex& index, vespalib::Executor& shared_executor) : _attr(attr), _generation_handler(generation_handler), - _store(store), _index(index), _shared_executor(shared_executor), _queue(MAX_PENDING), _pending(0) - {} + { + (void) store; + } void add(uint32_t lid) override; void wait_complete() override { drainUntilPending(0); @@ -136,7 +137,6 @@ private: static constexpr uint32_t MAX_PENDING = 1000; TensorAttribute& _attr; const vespalib::GenerationHandler& _generation_handler; - TensorStore& _store; NearestNeighborIndex& _index; vespalib::Executor& _shared_executor; std::mutex _mutex; |