summaryrefslogtreecommitdiffstats
path: root/eval
diff options
context:
space:
mode:
authorHåvard Pettersen <havardpe@yahooinc.com>2023-09-07 13:54:39 +0000
committerHåvard Pettersen <havardpe@yahooinc.com>2023-09-07 13:54:39 +0000
commit864b2d90e21e15628fb03d9797d70575e4159441 (patch)
tree681a7cb2797eb92ebf42dfbf2cf29d391d6b2a86 /eval
parentb1ba5c2995b76cbee5830a9959cd7b22364e5b65 (diff)
also test with trivial dimensions
Diffstat (limited to 'eval')
-rw-r--r--eval/src/tests/instruction/universal_dot_product/universal_dot_product_test.cpp2
-rw-r--r--eval/src/vespa/eval/instruction/universal_dot_product.cpp8
2 files changed, 4 insertions, 6 deletions
diff --git a/eval/src/tests/instruction/universal_dot_product/universal_dot_product_test.cpp b/eval/src/tests/instruction/universal_dot_product/universal_dot_product_test.cpp
index a25dba64671..4ca2a5ef79a 100644
--- a/eval/src/tests/instruction/universal_dot_product/universal_dot_product_test.cpp
+++ b/eval/src/tests/instruction/universal_dot_product/universal_dot_product_test.cpp
@@ -309,6 +309,7 @@ TEST(UniversalDotProductTest, nonforwarding_empty_result) {
TEST(UniversalDotProductTest, forwarding_expanding_reduce) {
verify("reduce(5.0*y0_0,sum,y)");
+ verify("reduce(5.0*y0_0z1,sum,y)");
verify("reduce(z16*y0_0,sum,y)");
verify("reduce(x1_1*y0_0,sum,y)");
verify("reduce(x0_0*y1_1,sum,y)");
@@ -319,6 +320,7 @@ TEST(UniversalDotProductTest, forwarding_expanding_reduce) {
TEST(UniversalDotProductTest, nonforwarding_expanding_reduce) {
verify("reduce(x0_0*y1_1,sum,x,y)");
verify("reduce(x1_1*y0_0,sum,x,y)");
+ verify("reduce(x1_1*y0_0z1,sum,x,y)");
verify("reduce(x0_0y16*x1_1y16,sum,x)");
verify("reduce(x1_1y16*x0_0y16,sum,x)");
verify("reduce(x1_7*y1_1,sum,x,y)");
diff --git a/eval/src/vespa/eval/instruction/universal_dot_product.cpp b/eval/src/vespa/eval/instruction/universal_dot_product.cpp
index 209645743fa..19b839a4fd3 100644
--- a/eval/src/vespa/eval/instruction/universal_dot_product.cpp
+++ b/eval/src/vespa/eval/instruction/universal_dot_product.cpp
@@ -81,12 +81,8 @@ void my_universal_dot_product_op(InterpretedFunction::State &state, uint64_t par
template <typename OCT>
const Value &create_empty_result(const UniversalDotProductParam &param, Stash &stash) {
if (param.sparse_plan.res_dims() == 0) {
- if (param.dense_plan.res_stride.empty()) {
- return stash.create<DoubleValue>(0.0);
- } else {
- auto zero_cells = stash.create_array<OCT>(param.dense_plan.res_size);
- return stash.create<ValueView>(param.res_type, TrivialIndex::get(), TypedCells(zero_cells));
- }
+ auto zero_cells = stash.create_array<OCT>(param.dense_plan.res_size);
+ return stash.create<ValueView>(param.res_type, TrivialIndex::get(), TypedCells(zero_cells));
} else {
return stash.create<ValueView>(param.res_type, EmptyIndex::get(), TypedCells(nullptr, get_cell_type<OCT>(), 0));
}