24 #ifndef VISIONCPP_INCLUDE_FRAMEWORK_EVALUATOR_EVAL_EXPRESSION_EVAL_EXPR_STN_FILT_HPP_
25 #define VISIONCPP_INCLUDE_FRAMEWORK_EVALUATOR_EVAL_EXPRESSION_EVAL_EXPR_STN_FILT_HPP_
31 template <
typename C_OP,
size_t Halo_T,
size_t Halo_L,
size_t Halo_B,
32 size_t Halo_R,
typename LHS,
typename RHS,
size_t Cols,
size_t Rows,
33 size_t LfType,
size_t LVL,
typename Loc,
typename... Params>
38 template <
bool IsRoot,
size_t Halo_Top,
size_t Halo_Left,
size_t Halo_Butt,
39 size_t Halo_Right,
size_t Offset,
size_t Index,
size_t LC,
46 constexpr
size_t OutOffset =
OutputLocation<IsRoot, Offset + Index - 1>::ID;
47 constexpr
bool isLocal =
49 tools::tuple::get<OutOffset>(t))>::Type>::scope ==
scope::Local;
51 static constexpr
size_t RHSCount =
54 EvalExpr<LHS, Loc, Params...>::template eval_neighbour<
55 false, Halo_Top + Halo_T, Halo_Left + Halo_L, Halo_Butt + Halo_B,
56 Halo_Right + Halo_R, Offset, Index - 1 - RHSCount,
57 LC + Halo_L + Halo_R, LR + Halo_T + Halo_B>(cOffset, t)
60 auto rhs_acc =
EvalExpr<RHS, Loc, Params...>::template eval_neighbour<
61 false, Halo_Top, Halo_Left, Halo_Butt, Halo_Right,
62 Offset, Index - 1, LC, LR>(cOffset, t)
66 lhs_acc, LC + Halo_L + Halo_R, LR + Halo_T + Halo_B);
69 rhs_acc, RHS::Type::Cols, RHS::Type::Rows);
70 for (
int i = 0; i < LC; i += cOffset.cLRng) {
71 if (get_compare<isLocal, LC, Cols>(cOffset.l_c, i, cOffset.g_c)) {
72 for (
int j = 0; j < LR; j += cOffset.rLRng) {
73 if (get_compare<isLocal, LR, Rows>(cOffset.l_r, j, cOffset.g_r)) {
74 neighbour.set_offset(cOffset.l_c + Halo_L + i,
75 cOffset.l_r + Halo_T + j);
76 *(tools::tuple::get<OutOffset>(t).get_pointer() +
78 id_val<isLocal>(cOffset.l_r, cOffset.g_r) + j,
79 id_val<isLocal>(LC, Cols),
80 id_val<isLocal>(LR, Rows))) =
82 LfType, decltype(tools::tuple::get<OutOffset>(t))>::Type>(
83 typename C_OP::OP()(neighbour, filter));
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
ConstNeighbour is used to provide global access to the constant memory.
visioncpp::internal::EvalExpr< StnFilt< C_OP, Halo_T, Halo_L, Halo_B, Halo_R, LHS, RHS, Cols, Rows, LfType, LVL >, Loc, Params... >::eval_neighbour 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.
LocalNeighbour is used to provide local access for each element of the local memory based on the Coor...
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 StnFilt file.
This struct is used to trait the value type inside the accessor.