VisionCpp  0.0.1
expr_convertor.hpp
Go to the documentation of this file.
1 // This file is part of VisionCpp, a lightweight C++ template library
2 // for computer vision and image processing.
3 //
4 // Copyright (C) 2016 Codeplay Software Limited. All Rights Reserved.
5 //
6 // Contact: visioncpp@codeplay.com
7 //
8 // Licensed under the Apache License, Version 2.0 (the "License");
9 // you may not use this file except in compliance with the License.
10 // You may obtain a copy of the License at
11 //
12 // http://www.apache.org/licenses/LICENSE-2.0
13 //
14 // Unless required by applicable law or agreed to in writing, software
15 // distributed under the License is distributed on an "AS IS" BASIS,
16 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 // See the License for the specific language governing permissions and
18 // limitations under the License.
19 
20 /// \file expr_convertor.hpp
21 /// \brief this is used to replace the leaf node with a PlaceHolder node.
22 
23 #ifndef VISIONCPP_INCLUDE_FRAMEWORK_EXPR_CONVERTOR_EXPR_CONVERTOR_HPP_
24 #define VISIONCPP_INCLUDE_FRAMEWORK_EXPR_CONVERTOR_EXPR_CONVERTOR_HPP_
25 
26 namespace visioncpp {
27 namespace internal {
28 /// \struct PlaceHolder
29 /// \brief PlaceHolder is used to replace the Vision Memory in the LeafNode
30 /// containing sycl buffer. PlaceHolder contains the order of the leaf node in
31 /// the expression tree.
32 /// template parameters:
33 /// \tparam Memory_Type: represents the type of the memory
34 /// \tparam N: represents the order of the visionMemory in the LeafNode
35 /// \tparam C: contains the column size of the visionMemory
36 /// \tparam R: contains the row size of the visionMemory
37 template <size_t Memory_Type, size_t N, size_t C, size_t R, size_t Sc>
38 struct PlaceHolder {
39  static constexpr size_t I = N;
40  static constexpr size_t Cols = C;
41  static constexpr size_t Rows = R;
42  static constexpr size_t LeafType = Memory_Type;
44  using OutType = Type;
45  static constexpr size_t Scope = Sc;
46 };
47 
48 /// \brief LocalOutput:Local output is used for neighbour operation in order to
49 /// create a local memory for the output of non-terminal nodes in the expression
50 /// tree when the NeighbourOP is used.
51 template <bool PointOp, size_t IsRoot, size_t LC, size_t LR, typename Expr>
52 struct LocalOutput;
53 
54 /// \brief is used to count the total number of leafNode in the expression tree.
55 template <size_t Category, typename Expr>
56 struct LeafCount;
57 /// \brief is used to count the total number of local memory for the
58 /// subxpression.
59 template <size_t Category, typename Expr>
61 
62 // template <size_t Memory_Type, size_t N, size_t R = 0, size_t C = 0>
63 // struct PlaceHolder;
64 /// \brief it is used to create the PlaceHolder expression. The PlaceHolder
65 /// expression is a copy of expression type where the visionMemory of the
66 /// leaf node has been replaced with PlaceHolder.
67 template <size_t Category, typename Expr, size_t N>
69 
70 } // internal
71 } // visioncpp
72 // Static Operation Over Type
73 #include "leaf_count.hpp"
74 #include "local_mem_count.hpp"
75 #include "local_output.hpp"
78 #endif // VISIONCPP_INCLUDE_FRAMEWORK_EXPR_CONVERTOR_EXPR_CONVERTOR_HPP_
LeafCount used to counting terminal nodes.
LocalmemCount used to counting terminal nodes.
This file contains the different specialisations of the LocalOutput.
PlaceHolder expression helper is used to create an expression in which the leafNodes of visionMemorie...
VisionCpp namespace.
Definition: sycl/device.hpp:24
This file contains different specialisations leafNodes for different types of memory.
is used to count the total number of leafNode in the expression tree.
is used to count the total number of local memory for the subxpression.
LocalOutput:Local output is used for neighbour operation in order to create a local memory for the ou...
it is used to create the PlaceHolder expression.
PlaceHolder is used to replace the Vision Memory in the LeafNode containing sycl buffer.
static constexpr size_t Rows
static constexpr size_t LeafType
PlaceHolder< LeafType, N, C, R, Sc > Type
static constexpr size_t Scope
static constexpr size_t Cols