aboutsummaryrefslogtreecommitdiff
path: root/arm_compute
diff options
context:
space:
mode:
authorMichele Di Giorgio <michele.digiorgio@arm.com>2017-07-04 17:19:43 +0100
committerAnthony Barbier <anthony.barbier@arm.com>2018-09-17 14:16:42 +0100
commitef4b4ae784f7533ed6d9e7b51827a894c32ed48e (patch)
tree6f4268044be18c003f5136b8ef7c7c07e219f2bd /arm_compute
parentf87cc7f6fef95f9b022725304118796a6a764a7c (diff)
downloadComputeLibrary-ef4b4ae784f7533ed6d9e7b51827a894c32ed48e.tar.gz
COMPMID-438: Add support for floating point Min-Max Location layer.
Change-Id: I84ae564a40fc7320a6f94a84d53906ba51404f51 Reviewed-on: http://mpd-gerrit.cambridge.arm.com/79797 Reviewed-by: Anthony Barbier <anthony.barbier@arm.com> Tested-by: Kaizen <jeremy.johnson+kaizengerrit@arm.com>
Diffstat (limited to 'arm_compute')
-rw-r--r--arm_compute/core/CL/kernels/CLMinMaxLocationKernel.h8
-rw-r--r--arm_compute/core/NEON/kernels/NEMinMaxLocationKernel.h35
-rw-r--r--arm_compute/runtime/CL/functions/CLMinMaxLocation.h12
-rw-r--r--arm_compute/runtime/NEON/functions/NEMinMaxLocation.h8
4 files changed, 33 insertions, 30 deletions
diff --git a/arm_compute/core/CL/kernels/CLMinMaxLocationKernel.h b/arm_compute/core/CL/kernels/CLMinMaxLocationKernel.h
index 6a31f3cf18..03ae3c1b1f 100644
--- a/arm_compute/core/CL/kernels/CLMinMaxLocationKernel.h
+++ b/arm_compute/core/CL/kernels/CLMinMaxLocationKernel.h
@@ -51,8 +51,8 @@ public:
CLMinMaxKernel &operator=(CLMinMaxKernel &&) = default;
/** Initialise the kernel's input and output.
*
- * @param[in] input Input Image. Data types supported: U8 or S16.
- * @param[out] min_max Buffer of 2 elements to store the min value at position 0 and the max value at position 1. Data type supported: S32.
+ * @param[in] input Input Image. Data types supported: U8/S16/F32.
+ * @param[out] min_max Buffer of 2 elements to store the min value at position 0 and the max value at position 1. Data type supported: S32 if input type is U8/S16, F32 if input type is F32.
*/
void configure(const ICLImage *input, cl::Buffer *min_max);
@@ -84,8 +84,8 @@ public:
*
* @note When locations of min and max occurrences are requested, the reported number of locations is limited to the given array size.
*
- * @param[in] input Input image. Data types supported: U8 or S16.
- * @param[in] min_max Buffer of 2 elements which contains the min value at position 0 and the max value at position 1. Data type supported: S32
+ * @param[in] input Input image. Data types supported: U8/S16/F32.
+ * @param[out] min_max Buffer of 2 elements to store the min value at position 0 and the max value at position 1. Data type supported: S32 if input type is U8/S16, F32 if input type is F32.
* @param[out] min_max_count Buffer of 2 elements to store the min value occurrences at position 0 and the max value occurrences at position 1. Data type supported: S32
* @param[out] min_loc (Optional) Array of Coordinates2D used to store minimum value locations.
* @param[out] max_loc (Optional) Array of Coordinates2D used to store maximum value locations.
diff --git a/arm_compute/core/NEON/kernels/NEMinMaxLocationKernel.h b/arm_compute/core/NEON/kernels/NEMinMaxLocationKernel.h
index b5375f613b..7b2748deee 100644
--- a/arm_compute/core/NEON/kernels/NEMinMaxLocationKernel.h
+++ b/arm_compute/core/NEON/kernels/NEMinMaxLocationKernel.h
@@ -54,11 +54,11 @@ public:
/** Initialise the kernel's input and outputs.
*
- * @param[in] input Input Image. Data types supported: U8/S16.
- * @param[out] min Minimum value of image.
- * @param[out] max Maximum value of image.
+ * @param[in] input Input Image. Data types supported: U8/S16/F32.
+ * @param[out] min Minimum value of image. Data types supported: S32 if input type is U8/S16, F32 if input type is F32.
+ * @param[out] max Maximum value of image. Data types supported: S32 if input type is U8/S16, F32 if input type is F32.
*/
- void configure(const IImage *input, int32_t *min, int32_t *max);
+ void configure(const IImage *input, void *min, void *max);
/** Resets global minimum and maximum. */
void reset();
@@ -76,6 +76,11 @@ private:
* @param win The window to run the algorithm on.
*/
void minmax_S16(Window win);
+ /** Performs the min/max algorithm on F32 images on a given window.
+ *
+ * @param win The window to run the algorithm on.
+ */
+ void minmax_F32(Window win);
/** Common signature for all the specialised MinMax functions
*
* @param[in] window Region on which to execute the kernel.
@@ -87,12 +92,10 @@ private:
template <typename T>
void update_min_max(T min, T max);
- const IImage *_input; /**< Input image. */
- int32_t *_min; /**< Minimum value. */
- int32_t *_max; /**< Maximum value. */
- int32_t _min_init; /**< Value to initialise global minimum value. */
- int32_t _max_init; /**< Value to initialise global maximum value. */
- std::mutex _mtx; /**< Mutex used for result reduction. */
+ const IImage *_input; /**< Input image. */
+ void *_min; /**< Minimum value. */
+ void *_max; /**< Maximum value. */
+ std::mutex _mtx; /**< Mutex used for result reduction. */
};
/** Interface for the kernel to find min max locations of an image. */
@@ -114,15 +117,15 @@ public:
/** Initialise the kernel's input and outputs.
*
- * @param[in] input Input Image. Data types supported: U8 or S16.
- * @param[out] min Minimum value of image.
- * @param[out] max Maximum value of image.
+ * @param[in] input Input Image. Data types supported: U8/S16/F32.
+ * @param[out] min Minimum value of image. Data types supported: S32 if input type is U8/S16, F32 if input type is F32.
+ * @param[out] max Maximum value of image. Data types supported: S32 if input type is U8/S16, F32 if input type is F32.
* @param[out] min_loc Array of minimum value locations.
* @param[out] max_loc Array of maximum value locations.
* @param[out] min_count Number of minimum value encounters.
* @param[out] max_count Number of maximum value encounters.
*/
- void configure(const IImage *input, int32_t *min, int32_t *max,
+ void configure(const IImage *input, void *min, void *max,
ICoordinates2DArray *min_loc = nullptr, ICoordinates2DArray *max_loc = nullptr,
uint32_t *min_count = nullptr, uint32_t *max_count = nullptr);
@@ -149,8 +152,8 @@ private:
struct create_func_table;
const IImage *_input; /**< Input image. */
- int32_t *_min; /**< Minimum value. */
- int32_t *_max; /**< Maximum value. */
+ void *_min; /**< Minimum value. */
+ void *_max; /**< Maximum value. */
uint32_t *_min_count; /**< Count of minimum value encounters. */
uint32_t *_max_count; /**< Count of maximum value encounters. */
ICoordinates2DArray *_min_loc; /**< Locations of minimum values. */
diff --git a/arm_compute/runtime/CL/functions/CLMinMaxLocation.h b/arm_compute/runtime/CL/functions/CLMinMaxLocation.h
index 84fd67515b..52a2857d0b 100644
--- a/arm_compute/runtime/CL/functions/CLMinMaxLocation.h
+++ b/arm_compute/runtime/CL/functions/CLMinMaxLocation.h
@@ -55,15 +55,15 @@ public:
*
* @note When locations of min and max occurrences are requested, the reported number of locations is limited to the given array size.
*
- * @param[in] input Input image. Data types supported: U8 or S16.
- * @param[out] min Minimum value of image.
- * @param[out] max Maximum value of image.
+ * @param[in] input Input image. Data types supported: U8/S16/F32.
+ * @param[out] min Minimum value of image. Data types supported: S32 if input type is U8/S16, F32 if input type is F32.
+ * @param[out] max Maximum value of image. Data types supported: S32 if input type is U8/S16, F32 if input type is F32.
* @param[out] min_loc (Optional) Array of Coordinates2D used to store minimum value locations.
* @param[out] max_loc (Optional) Array of Coordinates2D used to store maximum value locations.
* @param[out] min_count (Optional) Number of minimum value encounters.
* @param[out] max_count (Optional) Number of maximum value encounters.
*/
- void configure(const ICLImage *input, int32_t *min, int32_t *max,
+ void configure(const ICLImage *input, void *min, void *max,
CLCoordinates2DArray *min_loc = nullptr, CLCoordinates2DArray *max_loc = nullptr,
uint32_t *min_count = nullptr, uint32_t *max_count = nullptr);
@@ -75,8 +75,8 @@ private:
CLMinMaxLocationKernel _min_max_loc_kernel; /**< Kernel that counts min/max occurrences and identifies their positions */
cl::Buffer _min_max_vals; /**< Buffer to collect min, max values */
cl::Buffer _min_max_count_vals; /**< Buffer to collect min, max values */
- int32_t *_min; /**< Minimum value. */
- int32_t *_max; /**< Maximum value. */
+ void *_min; /**< Minimum value. */
+ void *_max; /**< Maximum value. */
uint32_t *_min_count; /**< Minimum value occurrences. */
uint32_t *_max_count; /**< Maximum value occurrences. */
CLCoordinates2DArray *_min_loc; /**< Minimum value occurrences coordinates. */
diff --git a/arm_compute/runtime/NEON/functions/NEMinMaxLocation.h b/arm_compute/runtime/NEON/functions/NEMinMaxLocation.h
index 82e75ee48b..e658d22a66 100644
--- a/arm_compute/runtime/NEON/functions/NEMinMaxLocation.h
+++ b/arm_compute/runtime/NEON/functions/NEMinMaxLocation.h
@@ -48,15 +48,15 @@ public:
NEMinMaxLocation();
/** Initialise the kernel's inputs and outputs.
*
- * @param[in] input Input image. Data types supported: U8/S16.
- * @param[out] min Minimum value of image.
- * @param[out] max Maximum value of image.
+ * @param[in] input Input image. Data types supported: U8/S16/F32.
+ * @param[out] min Minimum value of image. Data types supported: S32 if input type is U8/S16, F32 if input type is F32.
+ * @param[out] max Maximum value of image. Data types supported: S32 if input type is U8/S16, F32 if input type is F32.
* @param[out] min_loc (Optional) Array of minimum value locations.
* @param[out] max_loc (Optional) Array of maximum value locations.
* @param[out] min_count (Optional) Number of minimum value encounters.
* @param[out] max_count (Optional) Number of maximum value encounters.
*/
- void configure(const IImage *input, int32_t *min, int32_t *max,
+ void configure(const IImage *input, void *min, void *max,
ICoordinates2DArray *min_loc = nullptr, ICoordinates2DArray *max_loc = nullptr,
uint32_t *min_count = nullptr, uint32_t *max_count = nullptr);