summaryrefslogtreecommitdiffstats
path: root/eval
diff options
context:
space:
mode:
authorArne Juul <arnej@verizonmedia.com>2020-06-12 13:10:13 +0000
committerArne Juul <arnej@verizonmedia.com>2020-06-12 13:35:11 +0000
commitb88fe841de3fd25b28392d1bb1b0d17f45e209f7 (patch)
treeb06417b4ebb28233c50ce507edad7df7fc061608 /eval
parent45609f96bfe82638e8d136914e61e7bbf2269e74 (diff)
use typify_invoke instead of select_2
Diffstat (limited to 'eval')
-rw-r--r--eval/src/vespa/eval/tensor/dense/dense_dot_product_function.cpp5
-rw-r--r--eval/src/vespa/eval/tensor/dense/dense_lambda_peek_function.cpp5
-rw-r--r--eval/src/vespa/eval/tensor/dense/dense_xw_product_function.cpp6
3 files changed, 10 insertions, 6 deletions
diff --git a/eval/src/vespa/eval/tensor/dense/dense_dot_product_function.cpp b/eval/src/vespa/eval/tensor/dense/dense_dot_product_function.cpp
index c9ff57e4a65..9e30451cd67 100644
--- a/eval/src/vespa/eval/tensor/dense/dense_dot_product_function.cpp
+++ b/eval/src/vespa/eval/tensor/dense/dense_dot_product_function.cpp
@@ -48,7 +48,7 @@ void my_cblas_float_dot_product_op(eval::InterpretedFunction::State &state, uint
struct MyDotProductOp {
template <typename LCT, typename RCT>
- static auto get_fun() { return my_dot_product_op<LCT,RCT>; }
+ static auto invoke() { return my_dot_product_op<LCT,RCT>; }
};
eval::InterpretedFunction::op_function my_select(CellType lct, CellType rct) {
@@ -60,7 +60,8 @@ eval::InterpretedFunction::op_function my_select(CellType lct, CellType rct) {
return my_cblas_float_dot_product_op;
}
}
- return select_2<MyDotProductOp>(lct, rct);
+ using MyTypify = eval::TypifyCellType;
+ return typify_invoke<2,MyTypify,MyDotProductOp>(lct, rct);
}
} // namespace vespalib::tensor::<unnamed>
diff --git a/eval/src/vespa/eval/tensor/dense/dense_lambda_peek_function.cpp b/eval/src/vespa/eval/tensor/dense/dense_lambda_peek_function.cpp
index a5f532e643a..70bdc8ae7d6 100644
--- a/eval/src/vespa/eval/tensor/dense/dense_lambda_peek_function.cpp
+++ b/eval/src/vespa/eval/tensor/dense/dense_lambda_peek_function.cpp
@@ -45,7 +45,7 @@ void my_lambda_peek_op(InterpretedFunction::State &state, uint64_t param) {
struct MyLambdaPeekOp {
template <typename DST_CT, typename SRC_CT>
- static auto get_fun() { return my_lambda_peek_op<DST_CT, SRC_CT>; }
+ static auto invoke() { return my_lambda_peek_op<DST_CT, SRC_CT>; }
};
} // namespace vespalib::tensor::<unnamed>
@@ -64,7 +64,8 @@ InterpretedFunction::Instruction
DenseLambdaPeekFunction::compile_self(const TensorEngine &, Stash &stash) const
{
const Self &self = stash.create<Self>(result_type(), *_idx_fun);
- auto op = select_2<MyLambdaPeekOp>(result_type().cell_type(), child().result_type().cell_type());
+ using MyTypify = eval::TypifyCellType;
+ auto op = typify_invoke<2,MyTypify,MyLambdaPeekOp>(result_type().cell_type(), child().result_type().cell_type());
static_assert(sizeof(uint64_t) == sizeof(&self));
assert(child().result_type().is_dense());
return InterpretedFunction::Instruction(op, (uint64_t)&self);
diff --git a/eval/src/vespa/eval/tensor/dense/dense_xw_product_function.cpp b/eval/src/vespa/eval/tensor/dense/dense_xw_product_function.cpp
index a0d63a1ce1e..a8a896a893a 100644
--- a/eval/src/vespa/eval/tensor/dense/dense_xw_product_function.cpp
+++ b/eval/src/vespa/eval/tensor/dense/dense_xw_product_function.cpp
@@ -79,7 +79,7 @@ void my_cblas_float_xw_product_op(eval::InterpretedFunction::State &state, uint6
template <bool common_inner>
struct MyXWProductOp {
template <typename LCT, typename RCT>
- static auto get_fun() { return my_xw_product_op<LCT,RCT,common_inner>; }
+ static auto invoke() { return my_xw_product_op<LCT,RCT,common_inner>; }
};
template <bool common_inner>
@@ -92,7 +92,9 @@ eval::InterpretedFunction::op_function my_select2(CellType lct, CellType rct) {
return my_cblas_float_xw_product_op<common_inner>;
}
}
- return select_2<MyXWProductOp<common_inner>>(lct, rct);
+ using Target = MyXWProductOp<common_inner>;
+ using MyTypify = eval::TypifyCellType;
+ return typify_invoke<2,MyTypify,Target>(lct, rct);
}
eval::InterpretedFunction::op_function my_select(CellType lct, CellType rct, bool common_inner) {