24 #ifndef VISIONCPP_INCLUDE_FRAMEWORK_EVALUATOR_EVAL_EXPRESSION_EVAL_EXPR_R_BINARY_HPP_
25 #define VISIONCPP_INCLUDE_FRAMEWORK_EVALUATOR_EVAL_EXPRESSION_EVAL_EXPR_R_BINARY_HPP_
31 template <
typename BI_OP,
typename LHS,
typename RHS,
size_t Cols,
size_t Rows,
32 size_t LfType,
size_t LVL,
typename Loc,
typename... Params>
36 static typename BI_OP::OutType
41 typename BI_OP::OP()(tools::convert<typename BI_OP::InType1>(lhs_acc),
42 tools::convert<typename BI_OP::InType2>(rhs_acc));
45 template <
bool IsRoot,
size_t Halo_Top,
size_t Halo_Left,
size_t Halo_Butt,
46 size_t Halo_Right,
size_t Offset,
size_t Index,
size_t LC,
53 constexpr
size_t OutOffset =
OutputLocation<IsRoot, Offset + Index - 1>::ID;
54 constexpr
bool isLocal =
56 tools::tuple::get<OutOffset>(t))>::Type>::scope ==
scope::Local;
57 static constexpr
size_t RHSCount =
60 auto lhs_acc =
EvalExpr<LHS, Loc, Params...>::template eval_neighbour<
61 false, Halo_Top, Halo_Left, Halo_Butt, Halo_Right,
62 Offset, Index - 1 - RHSCount, LC, LR>(cOffset, t)
64 auto rhs_acc =
EvalExpr<RHS, Loc, Params...>::template eval_neighbour<
65 false, Halo_Top, Halo_Left, Halo_Butt, Halo_Right,
66 Offset, Index - 1, LC, LR>(cOffset, t)
69 for (
int i = 0; i < LC; i += cOffset.cLRng) {
70 if (get_compare<isLocal, LC, Cols>(cOffset.l_c, i, cOffset.g_c)) {
71 for (
int j = 0; j < LR; j += cOffset.rLRng) {
72 if (get_compare<isLocal, LR, Rows>(cOffset.l_r, j, cOffset.g_r)) {
75 *(tools::tuple::get<OutOffset>(t).get_pointer() +
77 id_val<isLocal>(cOffset.l_r, cOffset.g_r) + j,
78 id_val<isLocal>(LC, Cols),
79 id_val<isLocal>(LR, Rows))) =
81 LfType, decltype(tools::tuple::get<OutOffset>(t))>::Type>(
82 typename BI_OP::OP()(*(lhs_acc + child_index),
83 rhs_acc[child_index]));
92 return tools::tuple::get<OutOffset>(t);
static size_t calculate_index(size_t c, size_t r, size_t cols, size_t rows)
function calculate_index
static constexpr ScopeType Local
static BI_OP::OutType eval_point(Loc &cOffset, const tools::tuple::Tuple< Params... > &t)
evaluate function when the internal::ops_category is PointOP.
static auto eval_neighbour(Loc &cOffset, const tools::tuple::Tuple< Params... > &t) -> decltype(tools::tuple::get< OutputLocation< IsRoot, Offset+Index - 1 >::ID >(t))
evaluate function when the internal::ops_category is NeighbourOP.
eval_global_neighbour function:
is used to count the total number of local memory for the subxpression.
This class is used to determine the ElementType of accessor template parameters.
This is used to find whether a node should use a global memory output or a local memory output is cre...
The definition is in RBiOP file.
This struct is used to trait the value type inside the accessor.