diff options
author | Arne Juul <arnej@verizonmedia.com> | 2020-11-24 20:35:04 +0000 |
---|---|---|
committer | Arne Juul <arnej@verizonmedia.com> | 2020-11-27 07:07:14 +0000 |
commit | 127115efbaed70330cdde3d0b7d5032bed1f91aa (patch) | |
tree | a3863ee37e6e1982edd3ceac2042e9e4321be407 /eval | |
parent | 2e8b2724c9f3729dc26f71568c0d4873c8617755 (diff) |
test with FastValue instead of DefaultTensorEngine
Diffstat (limited to 'eval')
3 files changed, 7 insertions, 12 deletions
diff --git a/eval/src/tests/eval/function_speed/function_speed_test.cpp b/eval/src/tests/eval/function_speed/function_speed_test.cpp index 1295f482f76..8e8bed58991 100644 --- a/eval/src/tests/eval/function_speed/function_speed_test.cpp +++ b/eval/src/tests/eval/function_speed/function_speed_test.cpp @@ -6,11 +6,10 @@ #include <vespa/eval/eval/interpreted_function.h> #include <vespa/eval/eval/simple_tensor_engine.h> #include <vespa/vespalib/util/benchmark_timer.h> -#include <vespa/eval/tensor/default_tensor_engine.h> +#include <vespa/eval/eval/fast_value.h> using namespace vespalib::eval; using vespalib::BenchmarkTimer; -using vespalib::tensor::DefaultTensorEngine; double budget = 0.25; @@ -48,7 +47,7 @@ struct Fixture { Fixture(const vespalib::string &expr) : function(Function::parse(expr)), interpreted_simple(SimpleTensorEngine::ref(), *function, NodeTypes()), - interpreted(DefaultTensorEngine::ref(), *function, + interpreted(FastValueBuilderFactory::get(), *function, NodeTypes(*function, std::vector<ValueType>(function->num_params(), ValueType::double_type()))), separate(*function, PassParams::SEPARATE), array(*function, PassParams::ARRAY), 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 ee595606c14..1f74df6cb63 100644 --- a/eval/src/tests/eval/interpreted_function/interpreted_function_test.cpp +++ b/eval/src/tests/eval/interpreted_function/interpreted_function_test.cpp @@ -1,5 +1,6 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include <vespa/vespalib/testkit/test_kit.h> +#include <vespa/eval/eval/fast_value.h> #include <vespa/eval/eval/function.h> #include <vespa/eval/eval/tensor_spec.h> #include <vespa/eval/eval/operation.h> @@ -7,7 +8,6 @@ #include <vespa/eval/eval/test/eval_spec.h> #include <vespa/eval/eval/basic_nodes.h> #include <vespa/eval/eval/simple_tensor_engine.h> -#include <vespa/eval/tensor/default_tensor_engine.h> #include <vespa/vespalib/util/stringfmt.h> #include <vespa/vespalib/util/stash.h> #include <vespa/vespalib/test/insertion_operators.h> @@ -15,7 +15,6 @@ using namespace vespalib::eval; using vespalib::Stash; -using vespalib::tensor::DefaultTensorEngine; //----------------------------------------------------------------------------- @@ -53,9 +52,8 @@ struct MyEvalTest : test::EvalSpec::EvalTest { if (is_supported && !has_issues) { vespalib::string desc = as_string(param_names, param_values, expression); SimpleParams params(param_values); - verify_result(SimpleTensorEngine::ref(), *function, false, "[untyped simple] "+desc, params, expected_result); - verify_result(DefaultTensorEngine::ref(), *function, false, "[untyped prod] "+desc, params, expected_result); - verify_result(DefaultTensorEngine::ref(), *function, true, "[typed prod] "+desc, params, expected_result); + verify_result(SimpleTensorEngine::ref(), *function, false, "[untyped simple] "+desc, params, expected_result); + verify_result(FastValueBuilderFactory::get(), *function, true, "[typed prod] "+desc, params, expected_result); } } diff --git a/eval/src/tests/eval/multiply_add/multiply_add_test.cpp b/eval/src/tests/eval/multiply_add/multiply_add_test.cpp index 35cab0a6030..6cee82f9de2 100644 --- a/eval/src/tests/eval/multiply_add/multiply_add_test.cpp +++ b/eval/src/tests/eval/multiply_add/multiply_add_test.cpp @@ -1,15 +1,13 @@ // Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +#include <vespa/eval/eval/fast_value.h> #include <vespa/eval/eval/function.h> #include <vespa/eval/eval/llvm/compiled_function.h> #include <vespa/eval/eval/interpreted_function.h> -#include <vespa/eval/tensor/default_tensor_engine.h> #include <vespa/vespalib/gtest/gtest.h> using namespace vespalib::eval; -using Engine = vespalib::tensor::DefaultTensorEngine; - double gcc_fun(double a, double b) { return (a * 3) + b; } @@ -18,7 +16,7 @@ TEST(MultiplyAddTest, multiply_add_gives_same_result) { auto fun = Function::parse("a*3+b"); CompiledFunction cfun(*fun, PassParams::ARRAY); NodeTypes node_types = NodeTypes(*fun, {ValueType::double_type(), ValueType::double_type()}); - InterpretedFunction ifun(Engine::ref(), *fun, node_types); + InterpretedFunction ifun(FastValueBuilderFactory::get(), *fun, node_types); auto llvm_fun = cfun.get_function(); //------------------------------------------------------------------------- double a = -1.0/3.0; |