aboutsummaryrefslogtreecommitdiff
path: root/arm_compute/runtime/CL/functions/CLArgMinMaxLayer.h
diff options
context:
space:
mode:
Diffstat (limited to 'arm_compute/runtime/CL/functions/CLArgMinMaxLayer.h')
-rw-r--r--arm_compute/runtime/CL/functions/CLArgMinMaxLayer.h52
1 files changed, 38 insertions, 14 deletions
diff --git a/arm_compute/runtime/CL/functions/CLArgMinMaxLayer.h b/arm_compute/runtime/CL/functions/CLArgMinMaxLayer.h
index b0d29bcefe..d340d20a1f 100644
--- a/arm_compute/runtime/CL/functions/CLArgMinMaxLayer.h
+++ b/arm_compute/runtime/CL/functions/CLArgMinMaxLayer.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2020 ARM Limited.
+ * Copyright (c) 2018-2021, 2023 Arm Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -24,10 +24,9 @@
#ifndef ARM_COMPUTE_CLARGMINMAXLAYER_H
#define ARM_COMPUTE_CLARGMINMAXLAYER_H
-#include "arm_compute/core/CL/kernels/CLArgMinMaxLayerKernel.h"
-#include "arm_compute/core/CL/kernels/CLReshapeLayerKernel.h"
#include "arm_compute/core/Types.h"
#include "arm_compute/runtime/CL/CLTensor.h"
+#include "arm_compute/runtime/CL/functions/CLReshapeLayer.h"
#include "arm_compute/runtime/IFunction.h"
#include "arm_compute/runtime/IMemoryManager.h"
#include "arm_compute/runtime/MemoryGroup.h"
@@ -36,6 +35,7 @@ namespace arm_compute
{
class ITensorInfo;
class ICLTensor;
+class CLArgMinMaxLayerKernel;
/** Function to calculate the index of the minimum or maximum values in a
* tensor based on an axis.
@@ -53,9 +53,31 @@ public:
* @param[in] memory_manager (Optional) Memory manager.
*/
CLArgMinMaxLayer(std::shared_ptr<IMemoryManager> memory_manager = nullptr);
+ /** Prevent instances of this class from being copied */
+ CLArgMinMaxLayer(const CLArgMinMaxLayer &) = delete;
+ /** Prevent instances of this class from being copied */
+ CLArgMinMaxLayer &operator=(const CLArgMinMaxLayer &) = delete;
+ /** Prevent instances of this class to be moved */
+ CLArgMinMaxLayer(CLArgMinMaxLayer &&) = delete;
+ /** Prevent instances of this class to be moved */
+ CLArgMinMaxLayer &operator=(CLArgMinMaxLayer &&) = delete;
+ /** Default destructor */
+ ~CLArgMinMaxLayer();
/** Set the input and output tensors.
*
- * @param[in] input Input source tensor. Data types supported: QASYMM8/F16/F32.
+ * Valid data layouts:
+ * - All
+ *
+ * Valid data type configurations:
+ * |src |dst |
+ * |:--------------|:---------|
+ * |QASYMM8 |U32, S32 |
+ * |QASYMM8_SIGNED |U32, S32 |
+ * |S32 |U32, S32 |
+ * |F16 |U32, S32 |
+ * |F32 |U32, S32 |
+ *
+ * @param[in] input Input source tensor. Data types supported: QASYMM8/QASYMM8_SIGNED/S32/F16/F32.
* @param[in] axis Axis to find max/min index.
* @param[out] output Output source tensor. Data types supported: U32/S32.
* @param[in] op Reduction operation to perform. Operations supported: ARG_IDX_MAX, ARG_IDX_MIN
@@ -64,15 +86,19 @@ public:
/** Set the input and output tensors.
*
* @param[in] compile_context The compile context to be used.
- * @param[in] input Input source tensor. Data types supported: QASYMM8/F16/F32.
+ * @param[in] input Input source tensor. Data types supported: QASYMM8/QASYMM8_SIGNED/S32/F16/F32.
* @param[in] axis Axis to find max/min index.
* @param[out] output Output source tensor. Data types supported: U32/S32.
* @param[in] op Reduction operation to perform. Operations supported: ARG_IDX_MAX, ARG_IDX_MIN
*/
- void configure(const CLCompileContext &compile_context, const ICLTensor *input, int axis, ICLTensor *output, const ReductionOperation &op);
+ void configure(const CLCompileContext &compile_context,
+ const ICLTensor *input,
+ int axis,
+ ICLTensor *output,
+ const ReductionOperation &op);
/** Static function to check if given info will lead to a valid configuration of @ref CLArgMinMaxLayer
*
- * @param[in] input Input source tensor info. Data types supported: QASYMM8/F16/F32.
+ * @param[in] input Input source tensor info. Data types supported: QASYMM8/QASYMM8_SIGNED/S32/F16/F32.
* @param[in] axis Axis to find max/min index.
* @param[in] output Output source tensor info. Data types supported: U32/S32.
* @param[in] op Reduction operation to perform. Operations supported: ARG_IDX_MAX, ARG_IDX_MIN
@@ -85,13 +111,11 @@ public:
void run() override;
private:
- MemoryGroup _memory_group;
- std::vector<CLTensor> _results_vector;
- CLTensor _not_reshaped_output;
- std::vector<CLArgMinMaxLayerKernel> _reduction_kernels_vector;
- CLReshapeLayerKernel _reshape_kernel;
- unsigned int _num_of_stages;
- unsigned int _reduction_axis;
+ MemoryGroup _memory_group;
+ CLTensor _not_reshaped_output;
+ std::unique_ptr<CLArgMinMaxLayerKernel> _arg_min_max_kernel;
+ CLReshapeLayer _reshape;
+ unsigned int _reduction_axis;
};
} // namespace arm_compute
#endif /* ARM_COMPUTE_CLARGMINMAXLAYER_H */