summaryrefslogtreecommitdiffstats
path: root/searchlib
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2021-02-05 14:29:02 +0100
committerGitHub <noreply@github.com>2021-02-05 14:29:02 +0100
commit7284583b9eb8a87b635f1e5d058255103d32cf44 (patch)
treed9055c49dde64f811cfc36e18f9abcd6f4eccfdd /searchlib
parentea83e34b058305cf78439a2f8cca5e72a6cbeb55 (diff)
parent07cc6c7476314d3fa79029201cd517b161d4c505 (diff)
Merge pull request #16406 from vespa-engine/balder/gc-unused-code
GC unused template
Diffstat (limited to 'searchlib')
-rw-r--r--searchlib/src/vespa/searchlib/attribute/attributevector.cpp7
-rw-r--r--searchlib/src/vespa/searchlib/tensor/serialized_fast_value_attribute.h12
-rw-r--r--searchlib/src/vespa/searchlib/tensor/streamed_value_store.cpp2
-rw-r--r--searchlib/src/vespa/searchlib/tensor/streamed_value_store.h4
-rw-r--r--searchlib/src/vespa/searchlib/tensor/tensor_store.cpp16
-rw-r--r--searchlib/src/vespa/searchlib/tensor/tensor_store.h33
6 files changed, 22 insertions, 52 deletions
diff --git a/searchlib/src/vespa/searchlib/attribute/attributevector.cpp b/searchlib/src/vespa/searchlib/attribute/attributevector.cpp
index b7935cc09ee..79e4b1e95ef 100644
--- a/searchlib/src/vespa/searchlib/attribute/attributevector.cpp
+++ b/searchlib/src/vespa/searchlib/attribute/attributevector.cpp
@@ -47,13 +47,6 @@ const vespalib::string docIdLimitTag = "docIdLimit";
constexpr size_t DIRECTIO_ALIGNMENT(4096);
-template <typename T>
-struct FuncMax : public std::binary_function<T, T, T> {
- T operator() (const T & x, const T & y) const {
- return std::max(x, y);
- }
-};
-
}
namespace search {
diff --git a/searchlib/src/vespa/searchlib/tensor/serialized_fast_value_attribute.h b/searchlib/src/vespa/searchlib/tensor/serialized_fast_value_attribute.h
index cc559d9b758..789bf610d95 100644
--- a/searchlib/src/vespa/searchlib/tensor/serialized_fast_value_attribute.h
+++ b/searchlib/src/vespa/searchlib/tensor/serialized_fast_value_attribute.h
@@ -21,12 +21,12 @@ class SerializedFastValueAttribute : public TensorAttribute {
StreamedValueStore _streamedValueStore; // data store for serialized tensors
public:
SerializedFastValueAttribute(vespalib::stringref baseFileName, const Config &cfg);
- virtual ~SerializedFastValueAttribute();
- virtual void setTensor(DocId docId, const vespalib::eval::Value &tensor) override;
- virtual std::unique_ptr<vespalib::eval::Value> getTensor(DocId docId) const override;
- virtual bool onLoad() override;
- virtual std::unique_ptr<AttributeSaver> onInitSave(vespalib::stringref fileName) override;
- virtual void compactWorst() override;
+ ~SerializedFastValueAttribute() override;
+ void setTensor(DocId docId, const vespalib::eval::Value &tensor) override;
+ std::unique_ptr<vespalib::eval::Value> getTensor(DocId docId) const override;
+ bool onLoad() override;
+ std::unique_ptr<AttributeSaver> onInitSave(vespalib::stringref fileName) override;
+ void compactWorst() override;
};
}
diff --git a/searchlib/src/vespa/searchlib/tensor/streamed_value_store.cpp b/searchlib/src/vespa/searchlib/tensor/streamed_value_store.cpp
index 4ca761159fe..938ba06d445 100644
--- a/searchlib/src/vespa/searchlib/tensor/streamed_value_store.cpp
+++ b/searchlib/src/vespa/searchlib/tensor/streamed_value_store.cpp
@@ -156,7 +156,7 @@ StreamedValueStore::TensorEntryImpl<CT>::~TensorEntryImpl() = default;
constexpr size_t MIN_BUFFER_ARRAYS = 8192;
-StreamedValueStore::TensorBufferType::TensorBufferType()
+StreamedValueStore::TensorBufferType::TensorBufferType() noexcept
: ParentType(1, MIN_BUFFER_ARRAYS, TensorStoreType::RefType::offsetSize())
{
}
diff --git a/searchlib/src/vespa/searchlib/tensor/streamed_value_store.h b/searchlib/src/vespa/searchlib/tensor/streamed_value_store.h
index a9353c37a06..111271c65a3 100644
--- a/searchlib/src/vespa/searchlib/tensor/streamed_value_store.h
+++ b/searchlib/src/vespa/searchlib/tensor/streamed_value_store.h
@@ -54,8 +54,8 @@ private:
using ParentType::_emptyEntry;
using CleanContext = typename ParentType::CleanContext;
public:
- TensorBufferType();
- virtual void cleanHold(void* buffer, size_t offset, ElemCount num_elems, CleanContext clean_ctx) override;
+ TensorBufferType() noexcept;
+ void cleanHold(void* buffer, size_t offset, ElemCount num_elems, CleanContext clean_ctx) override;
};
TensorStoreType _concrete_store;
const vespalib::eval::ValueType _tensor_type;
diff --git a/searchlib/src/vespa/searchlib/tensor/tensor_store.cpp b/searchlib/src/vespa/searchlib/tensor/tensor_store.cpp
index 75f5addcb76..81a0d12be63 100644
--- a/searchlib/src/vespa/searchlib/tensor/tensor_store.cpp
+++ b/searchlib/src/vespa/searchlib/tensor/tensor_store.cpp
@@ -1,22 +1,14 @@
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include "tensor_store.h"
-#include <vespa/vespalib/datastore/datastore.hpp>
-namespace search {
-
-namespace tensor {
+namespace search::tensor {
TensorStore::TensorStore(vespalib::datastore::DataStoreBase &store)
: _store(store),
_typeId(0)
-{
-}
+{ }
-TensorStore::~TensorStore()
-{
-}
+TensorStore::~TensorStore() = default;
-} // namespace search::tensor
-
-} // namespace search
+}
diff --git a/searchlib/src/vespa/searchlib/tensor/tensor_store.h b/searchlib/src/vespa/searchlib/tensor/tensor_store.h
index 9cd470a9084..4c6314bfe3e 100644
--- a/searchlib/src/vespa/searchlib/tensor/tensor_store.h
+++ b/searchlib/src/vespa/searchlib/tensor/tensor_store.h
@@ -8,9 +8,7 @@
namespace vespalib::eval { struct Value; }
-namespace search {
-
-namespace tensor {
+namespace search::tensor {
/**
* Class for storing serialized tensors in memory, used by TensorAttribute.
@@ -34,37 +32,27 @@ public:
virtual ~TensorStore();
+ virtual void holdTensor(EntryRef ref) = 0;
+ virtual EntryRef move(EntryRef ref) = 0;
+
// Inherit doc from DataStoreBase
- void
- trimHoldLists(generation_t usedGen)
- {
+ void trimHoldLists(generation_t usedGen) {
_store.trimHoldLists(usedGen);
}
// Inherit doc from DataStoreBase
- void
- transferHoldLists(generation_t generation)
- {
+ void transferHoldLists(generation_t generation) {
_store.transferHoldLists(generation);
}
- void
- clearHoldLists()
- {
+ void clearHoldLists() {
_store.clearHoldLists();
}
- vespalib::MemoryUsage
- getMemoryUsage() const
- {
+ vespalib::MemoryUsage getMemoryUsage() const {
return _store.getMemoryUsage();
}
-
- virtual void holdTensor(EntryRef ref) = 0;
-
- virtual EntryRef move(EntryRef ref) = 0;
-
uint32_t startCompactWorstBuffer() {
return _store.startCompactWorstBuffer(_typeId);
}
@@ -74,7 +62,4 @@ public:
}
};
-
-} // namespace search::tensor
-
-} // namespace search
+}