aboutsummaryrefslogtreecommitdiff
path: root/arm_compute/runtime/CL/functions/CLPReluLayer.h
diff options
context:
space:
mode:
Diffstat (limited to 'arm_compute/runtime/CL/functions/CLPReluLayer.h')
-rw-r--r--arm_compute/runtime/CL/functions/CLPReluLayer.h65
1 files changed, 62 insertions, 3 deletions
diff --git a/arm_compute/runtime/CL/functions/CLPReluLayer.h b/arm_compute/runtime/CL/functions/CLPReluLayer.h
index eb3d3be3e3..08567cccfb 100644
--- a/arm_compute/runtime/CL/functions/CLPReluLayer.h
+++ b/arm_compute/runtime/CL/functions/CLPReluLayer.h
@@ -24,20 +24,72 @@
#ifndef ARM_COMPUTE_CLPRELULAYER_H
#define ARM_COMPUTE_CLPRELULAYER_H
-#include "arm_compute/core/Types.h"
-#include "arm_compute/runtime/CL/ICLSimpleFunction.h"
+#include "arm_compute/core/CL/kernels/CLFillBorderKernel.h"
+#include "arm_compute/runtime/CL/ICLOperator.h"
+#include "arm_compute/runtime/IFunction.h"
namespace arm_compute
{
class ICLTensor;
+namespace experimental
+{
/** Basic function to run @ref CLArithmeticOperationKernel for PRELU
*
* @note The function implements an activation layer with the PRELU activation function.
*/
-class CLPReluLayer : public ICLSimpleFunction
+class CLPReluLayer : public ICLOperator
{
public:
+ /** Default Constructor */
+ CLPReluLayer();
+ /** Set the input and output tensor.
+ *
+ * @note If the output tensor is a nullptr or is equal to the input, the activation function will be performed in-place
+ *
+ * @param[in] compile_context The compile context to be used.
+ * @param[in] input Source tensor. Data types supported: QASYMM8/QASYMM8_SIGNED/F16/F32.
+ * @param[in] alpha PRelu layer parameters. Data types supported: same of @p input.
+ * @param[out] output Destination tensor. Data type supported: same as @p input
+ */
+ void configure(const CLCompileContext &compile_context, ITensorInfo *input, ITensorInfo *alpha, ITensorInfo *output);
+ /** Static function to check if given info will lead to a valid configuration of @ref CLPReluLayer
+ *
+ * @param[in] input Source tensor info. Data types supported: QASYMM8/QASYMM8_SIGNED/F16/F32.
+ * @param[in] alpha PRelu layer parameters. Data types supported: same of @p input.
+ * @param[in] output Destination tensor info. Data type supported: same as @p input
+ *
+ * @return a status
+ */
+ static Status validate(const ITensorInfo *input, const ITensorInfo *alpha, const ITensorInfo *output);
+
+ // Inherited methods overridden:
+ void run(InputTensorMap inputs, OutputTensorMap outputs, OperatorTensorMap workspace) override;
+
+private:
+ CLFillBorderKernel _border_handler;
+};
+} // namespace experimental
+
+/** Basic function to run @ref CLArithmeticOperationKernel for PRELU
+ *
+ * @note The function implements an activation layer with the PRELU activation function.
+ */
+class CLPReluLayer : public IFunction
+{
+public:
+ /** Default Constructor */
+ CLPReluLayer();
+ /** Default Destructor */
+ ~CLPReluLayer();
+ /** Prevent instances of this class from being copied (As this class contains pointers) */
+ CLPReluLayer(const CLPReluLayer &) = delete;
+ /** Default move constructor */
+ CLPReluLayer(CLPReluLayer &&);
+ /** Prevent instances of this class from being copied (As this class contains pointers) */
+ CLPReluLayer &operator=(const CLPReluLayer &) = delete;
+ /** Default move assignment operator */
+ CLPReluLayer &operator=(CLPReluLayer &&);
/** Set the input and output tensor.
*
* @note If the output tensor is a nullptr or is equal to the input, the activation function will be performed in-place
@@ -66,6 +118,13 @@ public:
* @return a status
*/
static Status validate(const ITensorInfo *input, const ITensorInfo *alpha, const ITensorInfo *output);
+
+ // Inherited methods overridden:
+ void run() override;
+
+private:
+ struct Impl;
+ std::unique_ptr<Impl> _impl;
};
} // namespace arm_compute
#endif /* ARM_COMPUTE_CLPRELULAYER_H */