summaryrefslogtreecommitdiffstats
path: root/eval
diff options
context:
space:
mode:
authorArne Juul <arnej@verizonmedia.com>2021-03-10 10:54:05 +0000
committerArne Juul <arnej@verizonmedia.com>2021-03-10 11:53:52 +0000
commit5f3956d062e449b255b4ea89a4e284f4e97c3e79 (patch)
tree3152af581e153e4b01521f05d72aaa9c8945ec14 /eval
parent2e12bd8e014a221113ffad623ab0e29f7c5a5c2d (diff)
use TypifyCellMeta in sparse merge optimizer
Diffstat (limited to 'eval')
-rw-r--r--eval/src/vespa/eval/instruction/sparse_merge_function.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/eval/src/vespa/eval/instruction/sparse_merge_function.cpp b/eval/src/vespa/eval/instruction/sparse_merge_function.cpp
index 16f1496d8f5..728a5be43b6 100644
--- a/eval/src/vespa/eval/instruction/sparse_merge_function.cpp
+++ b/eval/src/vespa/eval/instruction/sparse_merge_function.cpp
@@ -87,11 +87,14 @@ void my_sparse_merge_op(InterpretedFunction::State &state, uint64_t param_in) {
}
struct SelectSparseMergeOp {
- template <typename CT, typename SINGLE_DIM, typename Fun>
- static auto invoke() { return my_sparse_merge_op<CT,SINGLE_DIM::value,Fun>; }
+ template <typename R1, typename SINGLE_DIM, typename Fun>
+ static auto invoke() {
+ using CT = CellValueType<R1::value.cell_type>;
+ return my_sparse_merge_op<CT,SINGLE_DIM::value,Fun>;
+ }
};
-using MyTypify = TypifyValue<TypifyCellType,TypifyBool,operation::TypifyOp2>;
+using MyTypify = TypifyValue<TypifyCellMeta,TypifyBool,operation::TypifyOp2>;
} // namespace <unnamed>
@@ -111,7 +114,7 @@ SparseMergeFunction::compile_self(const ValueBuilderFactory &factory, Stash &sta
lhs().result_type(), rhs().result_type(),
function(), factory);
size_t num_dims = result_type().count_mapped_dimensions();
- auto op = typify_invoke<3,MyTypify,SelectSparseMergeOp>(result_type().cell_type(),
+ auto op = typify_invoke<3,MyTypify,SelectSparseMergeOp>(result_type().cell_meta().limit(),
num_dims == 1,
function());
return InterpretedFunction::Instruction(op, wrap_param<MergeParam>(param));
@@ -121,6 +124,7 @@ bool
SparseMergeFunction::compatible_types(const ValueType &res, const ValueType &lhs, const ValueType &rhs)
{
if ((lhs.cell_type() == rhs.cell_type())
+ && (lhs.cell_type() == res.cell_type())
&& (lhs.count_mapped_dimensions() > 0)
&& (lhs.dense_subspace_size() == 1))
{