summaryrefslogtreecommitdiffstats
path: root/eval/src/tests/instruction/generic_map
diff options
context:
space:
mode:
authorArne Juul <arnej@verizonmedia.com>2020-10-22 07:23:00 +0000
committerArne Juul <arnej@verizonmedia.com>2020-10-22 07:45:50 +0000
commitcb62cd0e86a6bf708efa8212930c6ce99f5e6aac (patch)
treed14f4978b509c2736c63a0cc90c9a2dc574e3f74 /eval/src/tests/instruction/generic_map
parenteeed85a0c98c88c1de65ff7e821025f29fc0347e (diff)
add unit tests with FastValueBuilderFactory also
Diffstat (limited to 'eval/src/tests/instruction/generic_map')
-rw-r--r--eval/src/tests/instruction/generic_map/generic_map_test.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/eval/src/tests/instruction/generic_map/generic_map_test.cpp b/eval/src/tests/instruction/generic_map/generic_map_test.cpp
index 69fb417e0ad..63a9563a11b 100644
--- a/eval/src/tests/instruction/generic_map/generic_map_test.cpp
+++ b/eval/src/tests/instruction/generic_map/generic_map_test.cpp
@@ -1,6 +1,7 @@
// Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include <vespa/eval/eval/simple_value.h>
+#include <vespa/eval/eval/fast_value.h>
#include <vespa/eval/eval/value_codec.h>
#include <vespa/eval/instruction/generic_map.h>
#include <vespa/eval/eval/interpreted_function.h>
@@ -47,7 +48,7 @@ TensorSpec perform_generic_map(const TensorSpec &a, map_fun_t func, const ValueB
return spec_from_value(single.eval(std::vector<Value::CREF>({*lhs})));
}
-void test_generic_map(const ValueBuilderFactory &factory) {
+void test_generic_map_with(const ValueBuilderFactory &factory) {
for (const auto & layout : map_layouts) {
TensorSpec lhs = spec(layout, Div16(N()));
ValueType lhs_type = ValueType::from_spec(lhs.type());
@@ -61,7 +62,11 @@ void test_generic_map(const ValueBuilderFactory &factory) {
}
TEST(GenericMapTest, generic_map_works_for_simple_values) {
- test_generic_map(SimpleValueBuilderFactory::get());
+ test_generic_map_with(SimpleValueBuilderFactory::get());
+}
+
+TEST(GenericMapTest, generic_map_works_for_fast_values) {
+ test_generic_map_with(FastValueBuilderFactory::get());
}
TensorSpec immediate_generic_map(const TensorSpec &a, map_fun_t func, const ValueBuilderFactory &factory)