X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=documentation%2F_n_e_min_max_location_kernel_8h_source.xhtml;h=e71cb2e7c598da13540271fabe1607a5beb92bc2;hb=a437638028c216a03572593b9d4e3532df2a308d;hp=a34b5ddc46a93994420f1b6238c976daab730d1e;hpb=871448ee8eff790c4ccc3250008dd71170cc78b2;p=platform%2Fupstream%2Farmcl.git diff --git a/documentation/_n_e_min_max_location_kernel_8h_source.xhtml b/documentation/_n_e_min_max_location_kernel_8h_source.xhtml index a34b5dd..e71cb2e 100644 --- a/documentation/_n_e_min_max_location_kernel_8h_source.xhtml +++ b/documentation/_n_e_min_max_location_kernel_8h_source.xhtml @@ -40,7 +40,7 @@
ARM Compute Library -  17.03.1 +  17.04
@@ -116,7 +116,7 @@ $(document).ready(function(){initNavTree('_n_e_min_max_location_kernel_8h_source
NEMinMaxLocationKernel.h
-Go to the documentation of this file.
1 /*
2  * Copyright (c) 2016, 2017 ARM Limited.
3  *
4  * SPDX-License-Identifier: MIT
5  *
6  * Permission is hereby granted, free of charge, to any person obtaining a copy
7  * of this software and associated documentation files (the "Software"), to
8  * deal in the Software without restriction, including without limitation the
9  * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10  * sell copies of the Software, and to permit persons to whom the Software is
11  * furnished to do so, subject to the following conditions:
12  *
13  * The above copyright notice and this permission notice shall be included in all
14  * copies or substantial portions of the Software.
15  *
16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22  * SOFTWARE.
23  */
24 #ifndef __ARM_COMPUTE_NEMINMAXLOCATIONKERNEL_H__
25 #define __ARM_COMPUTE_NEMINMAXLOCATIONKERNEL_H__
26 
29 
30 #include <cstdint>
31 #include <mutex>
32 
33 namespace arm_compute
34 {
35 class ITensor;
36 using IImage = ITensor;
37 
39 class NEMinMaxKernel : public INEKernel
40 {
41 public:
45  NEMinMaxKernel(const NEMinMaxKernel &) = delete;
47  NEMinMaxKernel &operator=(const NEMinMaxKernel &) = delete;
49  NEMinMaxKernel(NEMinMaxKernel &&) = default;
53  ~NEMinMaxKernel() = default;
54 
61  void configure(const IImage *input, int32_t *min, int32_t *max);
63  void reset();
64 
65  // Inherited methods overridden:
66  void run(const Window &window) override;
67 
68 private:
73  void minmax_U8(const Window &win);
78  void minmax_S16(const Window &win);
83  using MinMaxFunction = void (NEMinMaxKernel::*)(const Window &window);
85  MinMaxFunction _func;
87  template <typename T>
88  void update_min_max(T min, T max);
89 
90  const IImage *_input;
91  int32_t *_min;
92  int32_t *_max;
93  int32_t _min_init;
94  int32_t _max_init;
95  std::mutex _mtx;
96 };
97 
100 {
101 public:
113  ~NEMinMaxLocationKernel() = default;
114 
125  void configure(const IImage *input, int32_t *min, int32_t *max,
126  ICoordinates2DArray *min_loc = nullptr, ICoordinates2DArray *max_loc = nullptr,
127  uint32_t *min_count = nullptr, uint32_t *max_count = nullptr);
128 
129  // Inherited methods overridden:
130  void run(const Window &window) override;
131  bool is_parallelisable() const override;
132 
133 private:
138  template <class T, bool count_min, bool count_max, bool loc_min, bool loc_max>
139  void minmax_loc(const Window &win);
144  using MinMaxLocFunction = void (NEMinMaxLocationKernel::*)(const Window &window);
146  MinMaxLocFunction _func;
148  template <class T, typename>
149  struct create_func_table;
150 
151  const IImage *_input;
152  int32_t *_min;
153  int32_t *_max;
154  uint32_t *_min_count;
155  uint32_t *_max_count;
156  ICoordinates2DArray *_min_loc;
157  ICoordinates2DArray *_max_loc;
158  unsigned int _processed_elements;
159 };
160 }
161 #endif /*__ARM_COMPUTE_NEMINMAXLOCATIONKERNEL_H__ */
Common interface for all kernels implemented in C++.
Definition: ICPPKernel.h:34
+Go to the documentation of this file.
1 /*
2  * Copyright (c) 2016, 2017 ARM Limited.
3  *
4  * SPDX-License-Identifier: MIT
5  *
6  * Permission is hereby granted, free of charge, to any person obtaining a copy
7  * of this software and associated documentation files (the "Software"), to
8  * deal in the Software without restriction, including without limitation the
9  * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10  * sell copies of the Software, and to permit persons to whom the Software is
11  * furnished to do so, subject to the following conditions:
12  *
13  * The above copyright notice and this permission notice shall be included in all
14  * copies or substantial portions of the Software.
15  *
16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22  * SOFTWARE.
23  */
24 #ifndef __ARM_COMPUTE_NEMINMAXLOCATIONKERNEL_H__
25 #define __ARM_COMPUTE_NEMINMAXLOCATIONKERNEL_H__
26 
29 
30 #include <cstdint>
31 #include <mutex>
32 
33 namespace arm_compute
34 {
35 class ITensor;
36 using IImage = ITensor;
37 
39 class NEMinMaxKernel : public INEKernel
40 {
41 public:
45  NEMinMaxKernel(const NEMinMaxKernel &) = delete;
47  NEMinMaxKernel &operator=(const NEMinMaxKernel &) = delete;
49  NEMinMaxKernel(NEMinMaxKernel &&) = default;
53  ~NEMinMaxKernel() = default;
54 
61  void configure(const IImage *input, int32_t *min, int32_t *max);
63  void reset();
64 
65  // Inherited methods overridden:
66  void run(const Window &window) override;
67 
68 private:
73  void minmax_U8(const Window &win);
78  void minmax_S16(const Window &win);
83  using MinMaxFunction = void (NEMinMaxKernel::*)(const Window &window);
85  MinMaxFunction _func;
87  template <typename T>
88  void update_min_max(T min, T max);
89 
90  const IImage *_input;
91  int32_t *_min;
92  int32_t *_max;
93  int32_t _min_init;
94  int32_t _max_init;
95  std::mutex _mtx;
96 };
97 
100 {
101 public:
113  ~NEMinMaxLocationKernel() = default;
114 
125  void configure(const IImage *input, int32_t *min, int32_t *max,
126  ICoordinates2DArray *min_loc = nullptr, ICoordinates2DArray *max_loc = nullptr,
127  uint32_t *min_count = nullptr, uint32_t *max_count = nullptr);
128 
129  // Inherited methods overridden:
130  void run(const Window &window) override;
131  bool is_parallelisable() const override;
132 
133 private:
138  template <class T, bool count_min, bool count_max, bool loc_min, bool loc_max>
139  void minmax_loc(const Window &win);
144  using MinMaxLocFunction = void (NEMinMaxLocationKernel::*)(const Window &window);
146  MinMaxLocFunction _func;
148  template <class T, typename>
149  struct create_func_table;
150 
151  const IImage *_input;
152  int32_t *_min;
153  int32_t *_max;
154  uint32_t *_min_count;
155  uint32_t *_max_count;
156  ICoordinates2DArray *_min_loc;
157  ICoordinates2DArray *_max_loc;
158  unsigned int _num_elems_processed_per_iteration;
159 };
160 }
161 #endif /*__ARM_COMPUTE_NEMINMAXLOCATIONKERNEL_H__ */
Common interface for all kernels implemented in C++.
Definition: ICPPKernel.h:34
Interface for the kernel to find min max locations of an image.
Array of type T.
Definition: IArray.h:40
Interface for the kernel to perform min max search on an image.
@@ -140,7 +140,7 @@ $(document).ready(function(){initNavTree('_n_e_min_max_location_kernel_8h_source