VisionCpp
0.0.1
|
the definition is in LeafNode. More...
#include <leaf_node.hpp>
Public Types | |
using | Type = typename internal::OutputMemory< typename RHS::ElementType, RHS::LeafType, RHS::Cols, RHS::Rows, RHS::Level >::Type |
using | RHSExpr = RHS |
using | Scalar = typename Type::Scalar |
using | OutType = typename RHS::ElementType |
Public Member Functions | |
LeafNode (RHS dt) | |
LeafNode () | |
LeafNode (typename RHS::syclBuffer dt) | |
void | reset (bool reset) |
template<bool ForcedToExec, size_t LC, size_t LR, size_t LCT, size_t LRT, typename DeviceT > | |
LeafNode< typename RHS::Type, Level > | sub_expression_evaluation (const DeviceT &dev) |
sub_expression_evaluation More... | |
void | set_output (std::shared_ptr< Scalar > &ptr) |
set_output function is used to destroy the sycl buffer and manually allocate the data to the provided pointer. More... | |
void | reset_input (Scalar *dt) |
reset_input is used to manually reset the input value of an input sycl buffer. More... | |
void | lock () |
lock function is used to access the sycl buffer on the host using a host pointer. More... | |
void | unlock () |
The unlock function for destroying the host accessor. More... | |
Public Attributes | |
RHS | vilibMemory |
bool | subexpr_execution_reseter |
buffer copy is lightweight no need to pass by ref More... | |
Static Public Attributes | |
static constexpr bool | has_out = false |
static constexpr size_t | Level = LVL |
static constexpr size_t | LeafType = RHS::LeafType |
static constexpr size_t | RThread = RHS::Rows |
static constexpr size_t | CThread = RHS::Cols |
static constexpr size_t | ND_Category = internal::expr_category::Unary |
static constexpr bool | SubExpressionEvaluationNeeded |
static constexpr size_t | Operation_type = internal::ops_category::PointOP |
the definition is in LeafNode.
This file contains LeafNode struct which is a general representation of our terminal node in the expression tree.
template parameters:
RHS | is the visionMemory allocated to our terminal node. It can be Sycl memory(Sycl memory with map allocator and device only sycl memory ); Host Memory or VirtualMemory. |
LVL | the level of the node in the expression tree |
Definition at line 38 of file leaf_node.hpp.
using visioncpp::internal::LeafNode< RHS, LVL >::OutType = typename RHS::ElementType |
Definition at line 49 of file leaf_node.hpp.
using visioncpp::internal::LeafNode< RHS, LVL >::RHSExpr = RHS |
Definition at line 44 of file leaf_node.hpp.
using visioncpp::internal::LeafNode< RHS, LVL >::Scalar = typename Type::Scalar |
Definition at line 45 of file leaf_node.hpp.
using visioncpp::internal::LeafNode< RHS, LVL >::Type = typename internal::OutputMemory<typename RHS::ElementType, RHS::LeafType, RHS::Cols, RHS::Rows, RHS::Level>::Type |
Definition at line 40 of file leaf_node.hpp.
|
inline |
Definition at line 55 of file leaf_node.hpp.
|
inline |
Definition at line 56 of file leaf_node.hpp.
|
inline |
Definition at line 59 of file leaf_node.hpp.
|
inline |
lock function is used to access the sycl buffer on the host using a host pointer.
Because the host accessor is blocking. We are creating it dynamically so by calling the lock function. It is the responsibility of a user to call the unlock function in order to destroy the accessor once its work is finished. This is useful when we are dealing with video and we want to display each frame of the video at the end of each iteration.
Definition at line 113 of file leaf_node.hpp.
References visioncpp::internal::LeafNode< RHS, LVL >::vilibMemory.
|
inline |
Definition at line 61 of file leaf_node.hpp.
References visioncpp::internal::LeafNode< RHS, LVL >::reset(), and visioncpp::internal::LeafNode< RHS, LVL >::subexpr_execution_reseter.
Referenced by visioncpp::internal::LeafNode< RHS, LVL >::reset().
|
inline |
reset_input is used to manually reset the input value of an input sycl buffer.
This can be used when we are dealing with video streaming and we want to pass different input stream to the expression.
Definition at line 104 of file leaf_node.hpp.
References visioncpp::internal::LeafNode< RHS, LVL >::vilibMemory.
|
inline |
set_output function is used to destroy the sycl buffer and manually allocate the data to the provided pointer.
This is used when we needed to return the value of the device only buffer.
ptr | the pointer for manually allocating the data |
Definition at line 96 of file leaf_node.hpp.
References visioncpp::internal::LeafNode< RHS, LVL >::vilibMemory.
|
inline |
sub_expression_evaluation
This function is used to break the expression tree whenever necessary. The decision for breaking the tree will be determined based on the static parameter called SubExpressionEvaluationNeeded. When this is set to true, the sub_expression_evaluation is called recursively from the root of the tree. Each node based on their parent decision will decide to launch a kernel for itself. Also, they decide for each of their children whether or not to launch a kernel separately. template parameters:
ForcedToExec | : a boolean value representing the decision made by the parent of this node for launching a kernel. |
LC | is the column size of local memory required by Filter2D and DownSmplOP |
LR | is the row size of local memory required by Filter2D and DownSmplOP |
LCT | is the column size of workgroup |
LRT | is the row size of workgroup |
DeviceT | type representing the device function parameters: |
dev | : the selected device for executing the expression |
Definition at line 86 of file leaf_node.hpp.
References visioncpp::internal::LeafNode< RHS, LVL >::vilibMemory.
|
inline |
The unlock function for destroying the host accessor.
It must be called by user if the lock has been called in order to destroy the host accessor and release the execution.
Definition at line 118 of file leaf_node.hpp.
References visioncpp::internal::LeafNode< RHS, LVL >::vilibMemory.
|
staticconstexpr |
Definition at line 48 of file leaf_node.hpp.
|
staticconstexpr |
Definition at line 39 of file leaf_node.hpp.
|
staticconstexpr |
Definition at line 46 of file leaf_node.hpp.
|
staticconstexpr |
Definition at line 43 of file leaf_node.hpp.
Referenced by visioncpp::internal::SubExprRes< LC, LR, LCT, LRT, LVL, Expr, DeviceT >::get().
|
staticconstexpr |
Definition at line 50 of file leaf_node.hpp.
|
staticconstexpr |
Definition at line 54 of file leaf_node.hpp.
|
staticconstexpr |
Definition at line 47 of file leaf_node.hpp.
bool visioncpp::internal::LeafNode< RHS, LVL >::subexpr_execution_reseter |
buffer copy is lightweight no need to pass by ref
Definition at line 58 of file leaf_node.hpp.
Referenced by visioncpp::internal::LeafNode< RHS, LVL >::reset().
|
staticconstexpr |
Definition at line 52 of file leaf_node.hpp.
RHS visioncpp::internal::LeafNode< RHS, LVL >::vilibMemory |
Definition at line 51 of file leaf_node.hpp.
Referenced by visioncpp::internal::ExtractAccessor< expr_category::Unary, LeafNode< RHS, LVL > >::getDiscardWriteTuple(), visioncpp::internal::ExtractAccessor< expr_category::Unary, LeafNode< RHS, LVL > >::getTuple(), visioncpp::internal::ExtractAccessor< expr_category::Unary, LeafNode< RHS, LVL > >::getWriteTuple(), visioncpp::internal::LeafNode< RHS, LVL >::lock(), visioncpp::internal::LeafNode< RHS, LVL >::reset_input(), visioncpp::internal::LeafNode< RHS, LVL >::set_output(), visioncpp::internal::LeafNode< RHS, LVL >::sub_expression_evaluation(), and visioncpp::internal::LeafNode< RHS, LVL >::unlock().