24 #ifndef VISIONCPP_INCLUDE_FRAMEWORK_EVALUATOR_EVAL_EXPRESSION_EVAL_EXPR_R_UNARY_HPP_
25 #define VISIONCPP_INCLUDE_FRAMEWORK_EVALUATOR_EVAL_EXPRESSION_EVAL_EXPR_R_UNARY_HPP_
31 template <
typename UN_OP,
typename Nested,
size_t Cols,
size_t Rows,
32 size_t LfType,
size_t LVL,
typename Loc,
typename... Params>
33 struct EvalExpr<
RUnOP<UN_OP, Nested, Cols, Rows, LfType, LVL>, Loc, Params...> {
35 static typename UN_OP::OutType
38 return typename UN_OP::OP()(
39 tools::convert<typename UN_OP::InType>(nested_acc));
42 template <
bool IsRoot,
size_t Halo_Top,
size_t Halo_Left,
size_t Halo_Butt,
43 size_t Halo_Right,
size_t Offset,
size_t Index,
size_t LC,
50 constexpr
size_t OutOffset =
OutputLocation<IsRoot, Offset + Index - 1>::ID;
51 constexpr
bool isLocal =
53 tools::tuple::get<OutOffset>(t))>::Type>::scope ==
scope::Local;
54 auto nested_acc =
EvalExpr<Nested, Loc, Params...>::template eval_neighbour<
55 false, Halo_Top, Halo_Left, Halo_Butt, Halo_Right,
56 Offset, Index - 1, LC, LR>(cOffset, t)
58 for (
int i = 0; i < LC; i += cOffset.cLRng) {
59 if (get_compare<isLocal, LC, Cols>(cOffset.l_c, i, cOffset.g_c)) {
60 for (
int j = 0; j < LR; j += cOffset.rLRng) {
61 if (get_compare<isLocal, LR, Rows>(cOffset.l_r, j, cOffset.g_r)) {
62 *(tools::tuple::get<OutOffset>(t).get_pointer() +
64 id_val<isLocal>(cOffset.l_r, cOffset.g_r) + j,
65 id_val<isLocal>(LC, Cols),
66 id_val<isLocal>(LR, Rows))) =
68 LfType, decltype(tools::tuple::get<OutOffset>(t))>::Type>(
81 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 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.
static UN_OP::OutType eval_point(Loc &cOffset, const tools::tuple::Tuple< Params... > &t)
evaluate function when the internal::ops_category is PointOP.
eval_global_neighbour function:
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 RUnOP file.
This struct is used to trait the value type inside the accessor.