aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2024-04-26 07:09:42 +0200
committerGitHub <noreply@github.com>2024-04-26 07:09:42 +0200
commitface477e177b1fdd5462a5c961e2d00d43895b97 (patch)
tree2d0d66e94ec49ecd4113009e91b0bd73341a6770
parent8e0492ef4ff8416d12271768c58be79cf7a53914 (diff)
parent5553d03a2ea19017c9547478db70d1704d559f50 (diff)
Merge pull request #31055 from vespa-engine/balder/handle-tensor-not-present
Add final on MutableDenseValueView and use noexcept where applicable.
-rw-r--r--eval/src/vespa/eval/onnx/onnx_wrapper.cpp2
-rw-r--r--searchlib/src/vespa/searchlib/features/mutable_dense_value_view.h14
2 files changed, 8 insertions, 8 deletions
diff --git a/eval/src/vespa/eval/onnx/onnx_wrapper.cpp b/eval/src/vespa/eval/onnx/onnx_wrapper.cpp
index 5457a3a1d1c..e5924043a8c 100644
--- a/eval/src/vespa/eval/onnx/onnx_wrapper.cpp
+++ b/eval/src/vespa/eval/onnx/onnx_wrapper.cpp
@@ -163,7 +163,7 @@ class OnnxString {
private:
static Ort::AllocatorWithDefaultOptions _alloc;
Ort::AllocatedStringPtr _str;
- OnnxString(Ort::AllocatedStringPtr str) : _str(std::move(str)) {}
+ OnnxString(Ort::AllocatedStringPtr str) noexcept : _str(std::move(str)) {}
public:
OnnxString(const OnnxString &rhs) = delete;
OnnxString &operator=(const OnnxString &rhs) = delete;
diff --git a/searchlib/src/vespa/searchlib/features/mutable_dense_value_view.h b/searchlib/src/vespa/searchlib/features/mutable_dense_value_view.h
index 4794de23b4a..52576841093 100644
--- a/searchlib/src/vespa/searchlib/features/mutable_dense_value_view.h
+++ b/searchlib/src/vespa/searchlib/features/mutable_dense_value_view.h
@@ -12,20 +12,20 @@ using namespace vespalib::eval;
/**
* A dense tensor with a cells reference that can be modified.
*/
-class MutableDenseValueView : public Value {
+class MutableDenseValueView final : public Value {
private:
const ValueType _type;
TypedCells _cells;
public:
- MutableDenseValueView(const ValueType &type_in);
- void setCells(TypedCells cells_in) {
+ explicit MutableDenseValueView(const ValueType &type_in);
+ void setCells(TypedCells cells_in) noexcept {
assert(cells_in.type == _type.cell_type());
_cells = cells_in;
}
- const ValueType &type() const final override { return _type; }
- TypedCells cells() const final override { return _cells; }
- const Index &index() const final override { return TrivialIndex::get(); }
- vespalib::MemoryUsage get_memory_usage() const final override {
+ const ValueType &type() const override { return _type; }
+ TypedCells cells() const override { return _cells; }
+ const Index &index() const override { return TrivialIndex::get(); }
+ vespalib::MemoryUsage get_memory_usage() const override {
return self_memory_usage<MutableDenseValueView>();
}
};