24 #ifndef VISIONCPP_INCLUDE_FRAMEWORK_EXECUTOR_POLICY_FUSE_HPP_
25 #define VISIONCPP_INCLUDE_FRAMEWORK_EXECUTOR_POLICY_FUSE_HPP_
31 template <
size_t LCIn,
size_t LRIn,
size_t LCT,
size_t LRT,
typename Expr,
typename DeviceT>
37 static void fuse(Expr &expr,
const DeviceT &dev) {
43 tools::IfConst<(Expr::RThread > LRIn), LRIn, Expr::RThread>::Value;
45 tools::IfConst<(Expr::CThread > LCIn), LCIn, Expr::CThread>::Value;
47 constexpr
int rLThread =
50 constexpr
int cLThread =
53 constexpr
size_t rGThreads =
55 ((Expr::RThread / LR) + 1)>::Value) *
58 constexpr
size_t cGThreads =
60 ((Expr::CThread / LC) + 1)>::Value) *
62 dev.template execute<LC, LR, cGThreads, rGThreads, cLThread, rLThread>(
68 template <
size_t LC,
size_t LR,
size_t LCT,
size_t LRT,
size_t LVL,
69 typename RHS,
typename DeviceT>
87 template <
size_t LC,
size_t LR,
size_t LCT,
size_t LRT,
typename Expr,
89 inline void fuse(Expr expr,
const DeviceT &dev) {
void fuse(Expr expr, const DeviceT &dev)
function fuse
static void fuse(LeafNode< RHS, LVL > &expr, const DeviceT &dev)
when the node is a terminal node (leafNode) we do nothing as there is no need to run any expression
the FuseExpr when the expression type is not a terminal node (leafNode).
static void fuse(Expr &expr, const DeviceT &dev)
the fuse function for executing the given expr.
the definition is in LeafNode.