diff options
13 files changed, 42 insertions, 1 deletions
diff --git a/eval/src/tests/eval/compile_cache/compile_cache_test.cpp b/eval/src/tests/eval/compile_cache/compile_cache_test.cpp index 6565ece735e..c9d56de897c 100644 --- a/eval/src/tests/eval/compile_cache/compile_cache_test.cpp +++ b/eval/src/tests/eval/compile_cache/compile_cache_test.cpp @@ -79,6 +79,7 @@ TEST("require that different strings give different function keys") { struct CheckKeys : test::EvalSpec::EvalTest { bool failed = false; std::set<vespalib::string> seen_keys; + ~CheckKeys() override; bool check_key(const vespalib::string &key) { bool seen = (seen_keys.count(key) > 0); seen_keys.insert(key); @@ -104,6 +105,8 @@ struct CheckKeys : test::EvalSpec::EvalTest { double) override {} }; +CheckKeys::~CheckKeys() = default; + TEST_FF("require that all conformance expressions have different function keys", CheckKeys(), test::EvalSpec()) { @@ -245,6 +248,8 @@ struct CompileCheck : test::EvalSpec::EvalTest { double expect; Entry(CompileCache::Token::UP fun_in, const std::vector<double> ¶ms_in, double expect_in) : fun(std::move(fun_in)), params(params_in), expect(expect_in) {} + Entry(Entry&&) noexcept = default; + ~Entry(); }; std::vector<Entry> list; void next_expression(const std::vector<vespalib::string> &, @@ -273,6 +278,8 @@ struct CompileCheck : test::EvalSpec::EvalTest { } }; +CompileCheck::Entry::~Entry() = default; + TEST_F("compile sequentially, then run all conformance tests", test::EvalSpec()) { f1.add_all_cases(); for (size_t i = 0; i < 2; ++i) { diff --git a/eval/src/tests/eval/compiled_function/compiled_function_test.cpp b/eval/src/tests/eval/compiled_function/compiled_function_test.cpp index dc7fde7f435..45e0c6d08fc 100644 --- a/eval/src/tests/eval/compiled_function/compiled_function_test.cpp +++ b/eval/src/tests/eval/compiled_function/compiled_function_test.cpp @@ -78,6 +78,8 @@ struct MyEvalTest : test::EvalSpec::EvalTest { size_t fail_cnt = 0; bool print_pass = false; bool print_fail = false; + + ~MyEvalTest() override; virtual void next_expression(const std::vector<vespalib::string> ¶m_names, const vespalib::string &expression) override { @@ -122,6 +124,8 @@ struct MyEvalTest : test::EvalSpec::EvalTest { } }; +MyEvalTest::~MyEvalTest() = default; + TEST_FF("require that compiled evaluation passes all conformance tests", MyEvalTest(), test::EvalSpec()) { f1.print_fail = true; f2.add_all_cases(); diff --git a/eval/src/tests/eval/function/function_test.cpp b/eval/src/tests/eval/function/function_test.cpp index 793ba98c59b..64f9104d0e1 100644 --- a/eval/src/tests/eval/function/function_test.cpp +++ b/eval/src/tests/eval/function/function_test.cpp @@ -1035,6 +1035,7 @@ TEST("require that tensor cell cast must have valid cell type") { struct CheckExpressions : test::EvalSpec::EvalTest { bool failed = false; size_t seen_cnt = 0; + ~CheckExpressions() override; virtual void next_expression(const std::vector<vespalib::string> ¶m_names, const vespalib::string &expression) override { @@ -1051,6 +1052,8 @@ struct CheckExpressions : test::EvalSpec::EvalTest { double) override {} }; +CheckExpressions::~CheckExpressions() = default; + TEST_FF("require that all conformance test expressions can be parsed", CheckExpressions(), test::EvalSpec()) { diff --git a/eval/src/tests/eval/interpreted_function/interpreted_function_test.cpp b/eval/src/tests/eval/interpreted_function/interpreted_function_test.cpp index 05136e4f679..7cab1de7bab 100644 --- a/eval/src/tests/eval/interpreted_function/interpreted_function_test.cpp +++ b/eval/src/tests/eval/interpreted_function/interpreted_function_test.cpp @@ -26,6 +26,8 @@ struct MyEvalTest : test::EvalSpec::EvalTest { bool print_pass = false; bool print_fail = false; + ~MyEvalTest() override; + virtual void next_expression(const std::vector<vespalib::string> ¶m_names, const vespalib::string &expression) override { @@ -86,6 +88,8 @@ struct MyEvalTest : test::EvalSpec::EvalTest { } }; +MyEvalTest::~MyEvalTest() = default; + TEST_FF("require that interpreted evaluation passes all conformance tests", MyEvalTest(), test::EvalSpec()) { f1.print_fail = true; f2.add_all_cases(); diff --git a/eval/src/tests/eval/value_cache/value_cache_test.cpp b/eval/src/tests/eval/value_cache/value_cache_test.cpp index 361931c9dbe..3f6a134c862 100644 --- a/eval/src/tests/eval/value_cache/value_cache_test.cpp +++ b/eval/src/tests/eval/value_cache/value_cache_test.cpp @@ -21,8 +21,11 @@ struct MyFactory : ConstantValueFactory { ++create_cnt; return std::make_unique<MyValue>(double(atoi(path.c_str()))); } + ~MyFactory(); }; +MyFactory::~MyFactory() = default; + TEST_FF("require that values can be created", MyFactory(), ConstantValueCache(f1)) { ConstantValue::UP res = f2.create("1", "type"); EXPECT_TRUE(res->type().is_double()); diff --git a/eval/src/tests/tensor/instruction_benchmark/instruction_benchmark.cpp b/eval/src/tests/tensor/instruction_benchmark/instruction_benchmark.cpp index 786301a252f..065c9426452 100644 --- a/eval/src/tests/tensor/instruction_benchmark/instruction_benchmark.cpp +++ b/eval/src/tests/tensor/instruction_benchmark/instruction_benchmark.cpp @@ -270,7 +270,11 @@ struct BenchmarkResult { double star_rating; BenchmarkResult(const vespalib::string &desc_in, size_t num_values) : desc(desc_in), ref_time(std::nullopt), relative_perf(num_values, 0.0) {} + BenchmarkResult(const BenchmarkResult&); + BenchmarkResult(BenchmarkResult&&) noexcept = default; ~BenchmarkResult(); + BenchmarkResult& operator=(const BenchmarkResult&); + BenchmarkResult& operator=(BenchmarkResult&&) noexcept; void sample(size_t order, double time) { relative_perf[order] = time; if (order == 0) { @@ -305,8 +309,15 @@ struct BenchmarkResult { fprintf(stderr, "| %s\n", desc.c_str()); } }; + +BenchmarkResult::BenchmarkResult(const BenchmarkResult&) = default; + BenchmarkResult::~BenchmarkResult() = default; +BenchmarkResult& BenchmarkResult::operator=(const BenchmarkResult&) = default; + +BenchmarkResult& BenchmarkResult::operator=(BenchmarkResult&&) noexcept = default; + std::vector<BenchmarkResult> benchmark_results; //----------------------------------------------------------------------------- diff --git a/eval/src/vespa/eval/eval/fast_value.hpp b/eval/src/vespa/eval/eval/fast_value.hpp index a0a96bc4497..a40314430c7 100644 --- a/eval/src/vespa/eval/eval/fast_value.hpp +++ b/eval/src/vespa/eval/eval/fast_value.hpp @@ -149,7 +149,7 @@ inline bool is_fast(const Value::Index &index) { return (std::type_index(typeid(index)) == std::type_index(typeid(FastValueIndex))); } -inline bool are_fast(const Value::Index &a, const Value::Index &b) { +__attribute__((always_inline)) inline bool are_fast(const Value::Index &a, const Value::Index &b) { return (is_fast(a) && is_fast(b)); } diff --git a/eval/src/vespa/eval/eval/test/eval_spec.cpp b/eval/src/vespa/eval/eval/test/eval_spec.cpp index 415404ffa50..02e9c34a75e 100644 --- a/eval/src/vespa/eval/eval/test/eval_spec.cpp +++ b/eval/src/vespa/eval/eval/test/eval_spec.cpp @@ -29,6 +29,8 @@ double byte(const vespalib::string &bits) { constexpr double my_nan = std::numeric_limits<double>::quiet_NaN(); constexpr double my_inf = std::numeric_limits<double>::infinity(); +EvalSpec::Expression::~Expression() = default; + EvalSpec::Expression &EvalSpec::Expression::add_case(std::initializer_list<double> param_values, double expected_result) { assert(param_values.size() == param_names.size()); diff --git a/eval/src/vespa/eval/eval/test/eval_spec.h b/eval/src/vespa/eval/eval/test/eval_spec.h index 57415a0d984..aaf3481241a 100644 --- a/eval/src/vespa/eval/eval/test/eval_spec.h +++ b/eval/src/vespa/eval/eval/test/eval_spec.h @@ -32,6 +32,7 @@ private: std::vector<Case> cases; Expression(std::initializer_list<vespalib::string> param_names_in, vespalib::string expression_in) : param_names(param_names_in), expression(expression_in) {} + ~Expression(); Expression &add_case(std::initializer_list<double> param_values, double expected_result); Expression &add_cases(std::initializer_list<double> a_values, fun_1_ref fun); diff --git a/eval/src/vespa/eval/eval/value_cache/constant_tensor_loader.cpp b/eval/src/vespa/eval/eval/value_cache/constant_tensor_loader.cpp index d6a7f54a78e..9af473f1f94 100644 --- a/eval/src/vespa/eval/eval/value_cache/constant_tensor_loader.cpp +++ b/eval/src/vespa/eval/eval/value_cache/constant_tensor_loader.cpp @@ -68,6 +68,8 @@ void decode_json(const vespalib::string &path, Slime &slime) { } // namespace vespalib::eval::<unnamed> +ConstantTensorLoader::~ConstantTensorLoader() = default; + ConstantValue::UP ConstantTensorLoader::create(const vespalib::string &path, const vespalib::string &type) const { diff --git a/eval/src/vespa/eval/eval/value_cache/constant_tensor_loader.h b/eval/src/vespa/eval/eval/value_cache/constant_tensor_loader.h index 9ecd9b8f2cf..c90ff611934 100644 --- a/eval/src/vespa/eval/eval/value_cache/constant_tensor_loader.h +++ b/eval/src/vespa/eval/eval/value_cache/constant_tensor_loader.h @@ -19,6 +19,7 @@ private: const ValueBuilderFactory &_factory; public: ConstantTensorLoader(const ValueBuilderFactory &factory) : _factory(factory) {} + ~ConstantTensorLoader(); ConstantValue::UP create(const vespalib::string &path, const vespalib::string &type) const override; }; diff --git a/eval/src/vespa/eval/eval/value_cache/constant_value_cache.cpp b/eval/src/vespa/eval/eval/value_cache/constant_value_cache.cpp index 87fd983fbc7..c03ef94b2ec 100644 --- a/eval/src/vespa/eval/eval/value_cache/constant_value_cache.cpp +++ b/eval/src/vespa/eval/eval/value_cache/constant_value_cache.cpp @@ -20,6 +20,8 @@ ConstantValueCache::ConstantValueCache(const ConstantValueFactory &factory) { } +ConstantValueCache::~ConstantValueCache() = default; + ConstantValue::UP ConstantValueCache::create(const vespalib::string &path, const vespalib::string &type) const { diff --git a/eval/src/vespa/eval/eval/value_cache/constant_value_cache.h b/eval/src/vespa/eval/eval/value_cache/constant_value_cache.h index 93fc9157c3b..6ba83027d12 100644 --- a/eval/src/vespa/eval/eval/value_cache/constant_value_cache.h +++ b/eval/src/vespa/eval/eval/value_cache/constant_value_cache.h @@ -50,6 +50,7 @@ private: public: ConstantValueCache(const ConstantValueFactory &factory); ConstantValue::UP create(const vespalib::string &path, const vespalib::string &type) const override; + ~ConstantValueCache() override; }; } // namespace vespalib::eval |