diff options
author | Arne H Juul <arnej27959@users.noreply.github.com> | 2021-03-12 11:11:36 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-12 11:11:36 +0100 |
commit | 5b11d76189c91705fc9e33b58f518b9379b096fa (patch) | |
tree | 3fc202e5d1e5a2c053667e7003501a772e3f50ef | |
parent | a3dbf3ecbf6dc04ad4550d5e26edba446ac6f920 (diff) | |
parent | 19b09c3439fc3730e94c6ebc9fa0db741001fa71 (diff) |
Merge pull request #16919 from vespa-engine/havardpe/improve-op-selection-for-generic-reduce
reduce typify expansion
-rw-r--r-- | eval/src/vespa/eval/instruction/generic_reduce.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/eval/src/vespa/eval/instruction/generic_reduce.cpp b/eval/src/vespa/eval/instruction/generic_reduce.cpp index 2c630ca0419..23e53e9734b 100644 --- a/eval/src/vespa/eval/instruction/generic_reduce.cpp +++ b/eval/src/vespa/eval/instruction/generic_reduce.cpp @@ -189,11 +189,11 @@ void my_full_reduce_op(State &state, uint64_t) { }; struct SelectGenericReduceOp { - template <typename ICM, typename OCM, typename AGGR> static auto invoke(const ReduceParam ¶m) { + template <typename ICM, typename OIS, typename AGGR> static auto invoke(const ReduceParam ¶m) { using ICT = CellValueType<ICM::value.cell_type>; - using OCT = CellValueType<OCM::value.cell_type>; + using OCT = CellValueType<CellMeta::reduce(ICM::value.cell_type, OIS::value).cell_type>; using AggrType = typename AGGR::template templ<OCT>; - if constexpr (OCM::value.is_scalar) { + if constexpr (OIS::value) { return my_full_reduce_op<ICT, AggrType>; } else { if (param.sparse_plan.should_forward_index()) { @@ -290,7 +290,7 @@ SparseReducePlan::~SparseReducePlan() = default; //----------------------------------------------------------------------------- -using ReduceTypify = TypifyValue<TypifyCellMeta,TypifyAggr>; +using ReduceTypify = TypifyValue<TypifyCellMeta,TypifyBool,TypifyAggr>; Instruction GenericReduce::make_instruction(const ValueType &result_type, @@ -300,7 +300,7 @@ GenericReduce::make_instruction(const ValueType &result_type, auto ¶m = stash.create<ReduceParam>(input_type, dimensions, factory); assert(result_type == param.res_type); assert(result_type.cell_meta().eq(CellMeta::reduce(input_type.cell_type(), result_type.is_double()))); - auto fun = typify_invoke<3,ReduceTypify,SelectGenericReduceOp>(input_type.cell_meta(), result_type.cell_meta().limit(), aggr, param); + auto fun = typify_invoke<3,ReduceTypify,SelectGenericReduceOp>(input_type.cell_meta(), result_type.cell_meta().is_scalar, aggr, param); return Instruction(fun, wrap_param<ReduceParam>(param)); } |