VisionCpp  0.0.1
Public Types | Public Member Functions | Public Attributes | Static Public Attributes | List of all members
visioncpp::internal::LeafNode< RHS, LVL > Struct Template Reference

the definition is in LeafNode. More...

#include <leaf_node.hpp>

Collaboration diagram for visioncpp::internal::LeafNode< RHS, LVL >:

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, Levelsub_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
 

Detailed Description

template<typename RHS, size_t LVL>
struct visioncpp::internal::LeafNode< RHS, LVL >

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:

Template Parameters
RHSis 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.
LVLthe level of the node in the expression tree

Definition at line 38 of file leaf_node.hpp.

Member Typedef Documentation

◆ OutType

template<typename RHS , size_t LVL>
using visioncpp::internal::LeafNode< RHS, LVL >::OutType = typename RHS::ElementType

Definition at line 49 of file leaf_node.hpp.

◆ RHSExpr

template<typename RHS , size_t LVL>
using visioncpp::internal::LeafNode< RHS, LVL >::RHSExpr = RHS

Definition at line 44 of file leaf_node.hpp.

◆ Scalar

template<typename RHS , size_t LVL>
using visioncpp::internal::LeafNode< RHS, LVL >::Scalar = typename Type::Scalar

Definition at line 45 of file leaf_node.hpp.

◆ Type

template<typename RHS , size_t LVL>
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.

Constructor & Destructor Documentation

◆ LeafNode() [1/3]

template<typename RHS , size_t LVL>
visioncpp::internal::LeafNode< RHS, LVL >::LeafNode ( RHS  dt)
inline

Definition at line 55 of file leaf_node.hpp.

◆ LeafNode() [2/3]

template<typename RHS , size_t LVL>
visioncpp::internal::LeafNode< RHS, LVL >::LeafNode ( )
inline

Definition at line 56 of file leaf_node.hpp.

◆ LeafNode() [3/3]

template<typename RHS , size_t LVL>
visioncpp::internal::LeafNode< RHS, LVL >::LeafNode ( typename RHS::syclBuffer  dt)
inline

Definition at line 59 of file leaf_node.hpp.

Member Function Documentation

◆ lock()

template<typename RHS , size_t LVL>
void visioncpp::internal::LeafNode< RHS, LVL >::lock ( )
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.

Returns
void

Definition at line 113 of file leaf_node.hpp.

References visioncpp::internal::LeafNode< RHS, LVL >::vilibMemory.

◆ reset()

template<typename RHS , size_t LVL>
void visioncpp::internal::LeafNode< RHS, LVL >::reset ( bool  reset)
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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ reset_input()

template<typename RHS , size_t LVL>
void visioncpp::internal::LeafNode< RHS, LVL >::reset_input ( Scalar dt)
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.

Returns
void

Definition at line 104 of file leaf_node.hpp.

References visioncpp::internal::LeafNode< RHS, LVL >::vilibMemory.

◆ set_output()

template<typename RHS , size_t LVL>
void visioncpp::internal::LeafNode< RHS, LVL >::set_output ( std::shared_ptr< Scalar > &  ptr)
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.

Parameters
ptrthe pointer for manually allocating the data
Returns
void

Definition at line 96 of file leaf_node.hpp.

References visioncpp::internal::LeafNode< RHS, LVL >::vilibMemory.

◆ sub_expression_evaluation()

template<typename RHS , size_t LVL>
template<bool ForcedToExec, size_t LC, size_t LR, size_t LCT, size_t LRT, typename DeviceT >
LeafNode<typename RHS::Type, Level> visioncpp::internal::LeafNode< RHS, LVL >::sub_expression_evaluation ( const DeviceT &  dev)
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:

Template Parameters
ForcedToExec: a boolean value representing the decision made by the parent of this node for launching a kernel.
LCis the column size of local memory required by Filter2D and DownSmplOP
LRis the row size of local memory required by Filter2D and DownSmplOP
LCTis the column size of workgroup
LRTis the row size of workgroup
DeviceTtype representing the device function parameters:
Parameters
dev: the selected device for executing the expression
Returns
LeafNode

Definition at line 86 of file leaf_node.hpp.

References visioncpp::internal::LeafNode< RHS, LVL >::vilibMemory.

◆ unlock()

template<typename RHS , size_t LVL>
void visioncpp::internal::LeafNode< RHS, LVL >::unlock ( )
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.

Returns
void

Definition at line 118 of file leaf_node.hpp.

References visioncpp::internal::LeafNode< RHS, LVL >::vilibMemory.

Member Data Documentation

◆ CThread

template<typename RHS , size_t LVL>
constexpr size_t visioncpp::internal::LeafNode< RHS, LVL >::CThread = RHS::Cols
staticconstexpr

Definition at line 48 of file leaf_node.hpp.

◆ has_out

template<typename RHS , size_t LVL>
constexpr bool visioncpp::internal::LeafNode< RHS, LVL >::has_out = false
staticconstexpr

Definition at line 39 of file leaf_node.hpp.

◆ LeafType

template<typename RHS , size_t LVL>
constexpr size_t visioncpp::internal::LeafNode< RHS, LVL >::LeafType = RHS::LeafType
staticconstexpr

Definition at line 46 of file leaf_node.hpp.

◆ Level

template<typename RHS , size_t LVL>
constexpr size_t visioncpp::internal::LeafNode< RHS, LVL >::Level = LVL
staticconstexpr

◆ ND_Category

template<typename RHS , size_t LVL>
constexpr size_t visioncpp::internal::LeafNode< RHS, LVL >::ND_Category = internal::expr_category::Unary
staticconstexpr

Definition at line 50 of file leaf_node.hpp.

◆ Operation_type

template<typename RHS , size_t LVL>
constexpr size_t visioncpp::internal::LeafNode< RHS, LVL >::Operation_type = internal::ops_category::PointOP
staticconstexpr

Definition at line 54 of file leaf_node.hpp.

◆ RThread

template<typename RHS , size_t LVL>
constexpr size_t visioncpp::internal::LeafNode< RHS, LVL >::RThread = RHS::Rows
staticconstexpr

Definition at line 47 of file leaf_node.hpp.

◆ subexpr_execution_reseter

template<typename RHS , size_t LVL>
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().

◆ SubExpressionEvaluationNeeded

template<typename RHS , size_t LVL>
constexpr bool visioncpp::internal::LeafNode< RHS, LVL >::SubExpressionEvaluationNeeded
staticconstexpr
Initial value:
=
RHS::SubExpressionEvaluationNeeded

Definition at line 52 of file leaf_node.hpp.

◆ vilibMemory

template<typename RHS , size_t LVL>
RHS visioncpp::internal::LeafNode< RHS, LVL >::vilibMemory

The documentation for this struct was generated from the following file: