diff options
author | Håvard Pettersen <havardpe@oath.com> | 2021-03-10 11:00:27 +0000 |
---|---|---|
committer | Håvard Pettersen <havardpe@oath.com> | 2021-03-10 11:00:27 +0000 |
commit | 5996cbeee4e27aab7dc29617c674c8549cffbf49 (patch) | |
tree | a580e3cbd5306ae229ee8bde42b9362e8a6c61f9 /eval | |
parent | f1e049a2a96ca376436f19d8a2ec5cd67ee5a574 (diff) |
added alias for converting cell type to actual type
Diffstat (limited to 'eval')
-rw-r--r-- | eval/src/vespa/eval/eval/cell_type.h | 1 | ||||
-rw-r--r-- | eval/src/vespa/eval/instruction/generic_join.cpp | 6 | ||||
-rw-r--r-- | eval/src/vespa/eval/instruction/generic_reduce.cpp | 4 |
3 files changed, 6 insertions, 5 deletions
diff --git a/eval/src/vespa/eval/eval/cell_type.h b/eval/src/vespa/eval/eval/cell_type.h index ff82f1ed633..948bff97518 100644 --- a/eval/src/vespa/eval/eval/cell_type.h +++ b/eval/src/vespa/eval/eval/cell_type.h @@ -33,6 +33,7 @@ template <CellType cell_type> constexpr auto get_cell_value() { static_assert((cell_type == CellType::DOUBLE), "unknown cell type"); } } +template <CellType cell_type> using CellValueType = decltype(get_cell_value<cell_type>()); // meta-information about the cell type and 'scalar-ness' of values // that are operation results. Used to reduce the number of diff --git a/eval/src/vespa/eval/instruction/generic_join.cpp b/eval/src/vespa/eval/instruction/generic_join.cpp index f2b32c8ff67..8881794c6bb 100644 --- a/eval/src/vespa/eval/instruction/generic_join.cpp +++ b/eval/src/vespa/eval/instruction/generic_join.cpp @@ -125,9 +125,9 @@ void my_double_join_op(State &state, uint64_t param_in) { struct SelectGenericJoinOp { template <typename LCM, typename RCM, typename Fun> static auto invoke(const JoinParam ¶m) { constexpr CellMeta ocm = CellMeta::join(LCM::value, RCM::value); - using LCT = decltype(get_cell_value<LCM::value.cell_type>()); - using RCT = decltype(get_cell_value<RCM::value.cell_type>()); - using OCT = decltype(get_cell_value<ocm.cell_type>()); + using LCT = CellValueType<LCM::value.cell_type>; + using RCT = CellValueType<RCM::value.cell_type>; + using OCT = CellValueType<ocm.cell_type>; if constexpr (ocm.is_scalar) { return my_double_join_op<Fun>; } else { diff --git a/eval/src/vespa/eval/instruction/generic_reduce.cpp b/eval/src/vespa/eval/instruction/generic_reduce.cpp index f16867d4891..2c630ca0419 100644 --- a/eval/src/vespa/eval/instruction/generic_reduce.cpp +++ b/eval/src/vespa/eval/instruction/generic_reduce.cpp @@ -190,8 +190,8 @@ void my_full_reduce_op(State &state, uint64_t) { struct SelectGenericReduceOp { template <typename ICM, typename OCM, typename AGGR> static auto invoke(const ReduceParam ¶m) { - using ICT = decltype(get_cell_value<ICM::value.cell_type>()); - using OCT = decltype(get_cell_value<OCM::value.cell_type>()); + using ICT = CellValueType<ICM::value.cell_type>; + using OCT = CellValueType<OCM::value.cell_type>; using AggrType = typename AGGR::template templ<OCT>; if constexpr (OCM::value.is_scalar) { return my_full_reduce_op<ICT, AggrType>; |