diff options
author | Arne H Juul <arnej27959@users.noreply.github.com> | 2021-03-10 15:02:57 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-10 15:02:57 +0100 |
commit | aeeaabccf779ad49b1a75df655147b604d975655 (patch) | |
tree | cbee4255dfe6fd59297e16ed363d9c83c6a8b149 /eval | |
parent | bd5e70c244ee93c6fc60b9af4a586210b37e90fe (diff) | |
parent | 341f091c5cfb1571eeba56d158fcec93f56ff174 (diff) |
Merge pull request #16880 from vespa-engine/arnej/more-typify-cell-meta
Arnej/more typify cell meta
Diffstat (limited to 'eval')
3 files changed, 22 insertions, 12 deletions
diff --git a/eval/src/vespa/eval/instruction/sparse_full_overlap_join_function.cpp b/eval/src/vespa/eval/instruction/sparse_full_overlap_join_function.cpp index 2072555bb3d..0c6ac51cde0 100644 --- a/eval/src/vespa/eval/instruction/sparse_full_overlap_join_function.cpp +++ b/eval/src/vespa/eval/instruction/sparse_full_overlap_join_function.cpp @@ -72,11 +72,14 @@ void my_sparse_full_overlap_join_op(InterpretedFunction::State &state, uint64_t } struct SelectSparseFullOverlapJoinOp { - template <typename CT, typename Fun, typename SINGLE_DIM> - static auto invoke() { return my_sparse_full_overlap_join_op<CT,Fun,SINGLE_DIM::value>; } + template <typename R1, typename Fun, typename SINGLE_DIM> + static auto invoke() { + using CT = CellValueType<R1::value.cell_type>; + return my_sparse_full_overlap_join_op<CT,Fun,SINGLE_DIM::value>; + } }; -using MyTypify = TypifyValue<TypifyCellType,operation::TypifyOp2,TypifyBool>; +using MyTypify = TypifyValue<TypifyCellMeta,operation::TypifyOp2,TypifyBool>; bool is_sparse_like(const ValueType &type) { return ((type.count_mapped_dimensions() > 0) && (type.dense_subspace_size() == 1)); @@ -99,7 +102,7 @@ SparseFullOverlapJoinFunction::compile_self(const ValueBuilderFactory &factory, const auto ¶m = stash.create<JoinParam>(result_type(), lhs().result_type(), rhs().result_type(), function(), factory); assert(result_type() == ValueType::join(lhs().result_type(), rhs().result_type())); bool single_dim = (result_type().count_mapped_dimensions() == 1); - auto op = typify_invoke<3,MyTypify,SelectSparseFullOverlapJoinOp>(result_type().cell_type(), function(), single_dim); + auto op = typify_invoke<3,MyTypify,SelectSparseFullOverlapJoinOp>(result_type().cell_meta().limit(), function(), single_dim); return InterpretedFunction::Instruction(op, wrap_param<JoinParam>(param)); } 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)) { diff --git a/eval/src/vespa/eval/instruction/sparse_no_overlap_join_function.cpp b/eval/src/vespa/eval/instruction/sparse_no_overlap_join_function.cpp index 9c82b1f7bcd..2dfe1b07373 100644 --- a/eval/src/vespa/eval/instruction/sparse_no_overlap_join_function.cpp +++ b/eval/src/vespa/eval/instruction/sparse_no_overlap_join_function.cpp @@ -78,11 +78,14 @@ void my_sparse_no_overlap_join_op(InterpretedFunction::State &state, uint64_t pa } struct SelectSparseNoOverlapJoinOp { - template <typename CT, typename Fun> - static auto invoke() { return my_sparse_no_overlap_join_op<CT,Fun>; } + template <typename R1, typename Fun> + static auto invoke() { + using CT = CellValueType<R1::value.cell_type>; + return my_sparse_no_overlap_join_op<CT,Fun>; + } }; -using MyTypify = TypifyValue<TypifyCellType,operation::TypifyOp2>; +using MyTypify = TypifyValue<TypifyCellMeta,operation::TypifyOp2>; bool is_sparse_like(const ValueType &type) { return ((type.count_mapped_dimensions() > 0) && (type.dense_subspace_size() == 1)); @@ -105,7 +108,7 @@ SparseNoOverlapJoinFunction::compile_self(const ValueBuilderFactory &factory, St const auto ¶m = stash.create<JoinParam>(result_type(), lhs().result_type(), rhs().result_type(), function(), factory); - auto op = typify_invoke<2,MyTypify,SelectSparseNoOverlapJoinOp>(result_type().cell_type(), function()); + auto op = typify_invoke<2,MyTypify,SelectSparseNoOverlapJoinOp>(result_type().cell_meta().limit(), function()); return InterpretedFunction::Instruction(op, wrap_param<JoinParam>(param)); } |