From 864b2d90e21e15628fb03d9797d70575e4159441 Mon Sep 17 00:00:00 2001 From: HÃ¥vard Pettersen Date: Thu, 7 Sep 2023 13:54:39 +0000 Subject: also test with trivial dimensions --- .../universal_dot_product/universal_dot_product_test.cpp | 2 ++ eval/src/vespa/eval/instruction/universal_dot_product.cpp | 8 ++------ 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 const Value &create_empty_result(const UniversalDotProductParam ¶m, Stash &stash) { if (param.sparse_plan.res_dims() == 0) { - if (param.dense_plan.res_stride.empty()) { - return stash.create(0.0); - } else { - auto zero_cells = stash.create_array(param.dense_plan.res_size); - return stash.create(param.res_type, TrivialIndex::get(), TypedCells(zero_cells)); - } + auto zero_cells = stash.create_array(param.dense_plan.res_size); + return stash.create(param.res_type, TrivialIndex::get(), TypedCells(zero_cells)); } else { return stash.create(param.res_type, EmptyIndex::get(), TypedCells(nullptr, get_cell_type(), 0)); } -- cgit v1.2.3