diff options
author | Georgios Pinitas <georgios.pinitas@arm.com> | 2020-06-16 17:44:46 +0100 |
---|---|---|
committer | Michalis Spyrou <michalis.spyrou@arm.com> | 2020-06-17 09:29:40 +0000 |
commit | 1fd2c80692ed8ecefc4d8deb783564ad19eaf70c (patch) | |
tree | b44219bdc8bdc17cb2906dd50a5ba1ee1e6b12fc /arm_compute/runtime/NEON/functions/NEActivationLayer.h | |
parent | 27a9e4f10516679bc6e92bec104ae219e1fa7f15 (diff) | |
download | ComputeLibrary-1fd2c80692ed8ecefc4d8deb783564ad19eaf70c.tar.gz |
COMPMID-3375: Port NEActivationLayer functions/kernels to run on
different tensors.
Signed-off-by: Georgios Pinitas <georgios.pinitas@arm.com>
Change-Id: I98782bb73e9dc0899ffb1796aca6f99714adea94
Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/3343
Reviewed-by: Michalis Spyrou <michalis.spyrou@arm.com>
Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Tested-by: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'arm_compute/runtime/NEON/functions/NEActivationLayer.h')
-rw-r--r-- | arm_compute/runtime/NEON/functions/NEActivationLayer.h | 46 |
1 files changed, 42 insertions, 4 deletions
diff --git a/arm_compute/runtime/NEON/functions/NEActivationLayer.h b/arm_compute/runtime/NEON/functions/NEActivationLayer.h index 95901dc2d8..8ac2dae911 100644 --- a/arm_compute/runtime/NEON/functions/NEActivationLayer.h +++ b/arm_compute/runtime/NEON/functions/NEActivationLayer.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2019 ARM Limited. + * Copyright (c) 2017-2020 ARM Limited. * * SPDX-License-Identifier: MIT * @@ -27,6 +27,7 @@ #include "arm_compute/runtime/NEON/INESimpleFunctionNoBorder.h" #include "arm_compute/core/Types.h" +#include "arm_compute/runtime/NEON/INEOperator.h" namespace arm_compute { @@ -37,7 +38,7 @@ class ITensor; * * @note The function simulates an activation layer with the specified activation function. */ -class NEActivationLayer : public INESimpleFunctionNoBorder +class NEActivationLayer : public IFunction { public: /** Constructor @@ -45,14 +46,16 @@ public: * @param[in] ctx Runtime context to be used by the function */ NEActivationLayer(IRuntimeContext *ctx = nullptr); + /** Destructor */ + ~NEActivationLayer(); /** Prevent instances of this class from being copied (As this class contains pointers) */ NEActivationLayer(const NEActivationLayer &) = delete; /** Default move constructor */ - NEActivationLayer(NEActivationLayer &&) = default; + NEActivationLayer(NEActivationLayer &&); /** Prevent instances of this class from being copied (As this class contains pointers) */ NEActivationLayer &operator=(const NEActivationLayer &) = delete; /** Default move assignment operator */ - NEActivationLayer &operator=(NEActivationLayer &&) = default; + NEActivationLayer &operator=(NEActivationLayer &&); /** [NEActivationLayer snippet] **/ /** Set the input and output tensor. * @@ -75,6 +78,41 @@ public: * @return a status */ static Status validate(const ITensorInfo *input, const ITensorInfo *output, const ActivationLayerInfo &act_info); + + // Inherited methods overridden + void run() override; + +private: + struct Impl; + std::unique_ptr<Impl> _impl; +}; + +namespace experimental +{ +/** Basic function to run @ref NEActivationLayerKernel */ +class NEActivationLayer : public INEOperator +{ +public: + /** Set the input and output tensor. + * + * @param[in] input Source tensor info. Data types supported: QASYMM8/QASYMM8_SIGNED/QSYMM16/F16/F32. + * @param[out] output Destination tensor info. Data type supported: same as @p input + * @param[in] activation_info Activation layer parameters. + */ + void configure(const ITensorInfo *input, ITensorInfo *output, const ActivationLayerInfo &activation_info); + /** Static function to check if given info will lead to a valid configuration of @ref NEActivationLayer + * + * @param[in] input Source tensor info. Data types supported: QASYMM8/QASYMM8_SIGNED/QSYMM16/F16/F32. + * @param[in] output Destination tensor info. Data type supported: same as @p input + * @param[in] act_info Activation layer information. + * + * @return a status + */ + static Status validate(const ITensorInfo *input, const ITensorInfo *output, const ActivationLayerInfo &act_info); + + // Inherited methods overridden: + MemoryRequirements workspace() const override; }; +} // namespace experimental } // namespace arm_compute #endif /* ARM_COMPUTE_NEACTIVATIONLAYER_H */ |