diff options
Diffstat (limited to 'arm_compute/runtime/CL/functions/CLL2NormalizeLayer.h')
-rw-r--r-- | arm_compute/runtime/CL/functions/CLL2NormalizeLayer.h | 41 |
1 files changed, 32 insertions, 9 deletions
diff --git a/arm_compute/runtime/CL/functions/CLL2NormalizeLayer.h b/arm_compute/runtime/CL/functions/CLL2NormalizeLayer.h index 91c547b2cc..a8b356a708 100644 --- a/arm_compute/runtime/CL/functions/CLL2NormalizeLayer.h +++ b/arm_compute/runtime/CL/functions/CLL2NormalizeLayer.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2020 ARM Limited. + * Copyright (c) 2017-2021 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -24,11 +24,10 @@ #ifndef ARM_COMPUTE_CLL2NORMALIZELAYER_H #define ARM_COMPUTE_CLL2NORMALIZELAYER_H -#include "arm_compute/core/CL/kernels/CLL2NormalizeLayerKernel.h" #include "arm_compute/core/Types.h" #include "arm_compute/runtime/CL/CLTensor.h" -#include "arm_compute/runtime/CL/ICLSimpleFunction.h" #include "arm_compute/runtime/CL/functions/CLReductionOperation.h" +#include "arm_compute/runtime/CL/ICLSimpleFunction.h" #include "arm_compute/runtime/IMemoryManager.h" #include "arm_compute/runtime/MemoryGroup.h" @@ -37,7 +36,10 @@ namespace arm_compute { +class CLCompileContext; +class CLL2NormalizeLayerKernel; class ICLTensor; +class ITensorInfo; /** Basic function to perform a L2 normalization on a given axis. * @@ -50,9 +52,29 @@ class CLL2NormalizeLayer : public IFunction public: /** Constructor */ CLL2NormalizeLayer(std::shared_ptr<IMemoryManager> memory_manager = nullptr); + /** Default Destructor */ + ~CLL2NormalizeLayer(); + /** Prevent instances of this class from being copied (As this class contains pointers) */ + CLL2NormalizeLayer(const CLL2NormalizeLayer &) = delete; + /** Default move constructor */ + CLL2NormalizeLayer(CLL2NormalizeLayer &&) = default; + /** Prevent instances of this class from being copied (As this class contains pointers) */ + CLL2NormalizeLayer &operator=(const CLL2NormalizeLayer &) = delete; + /** Default move assignment operator */ + CLL2NormalizeLayer &operator=(CLL2NormalizeLayer &&) = default; /** Set the input and output tensors. * + * Valid data layouts: + * - NHWC + * - NCHW + * + * Valid data type configurations: + * |src |dst | + * |:--------|:---------| + * |F16 |F16 | + * |F32 |F32 | + * * @param[in] input Source tensor. Data types supported: F16/F32. Data layouts supported: NCHW/NHWC. * @param[out] output Destination tensor. Data types and data layouts supported: Same as @p input. * @param[in] axis Axis along which to reduce. Negative values wrap around. Maximum supported actual reduction axis : 2 @@ -67,7 +89,8 @@ public: * @param[in] axis Axis along which to reduce. Negative values wrap around. Maximum supported actual reduction axis : 2 * @param[in] epsilon (Optional) Lower bound value for the normalization. */ - void configure(const CLCompileContext &compile_context, ICLTensor *input, ICLTensor *output, int axis, float epsilon = 1e-12f); + void configure( + const CLCompileContext &compile_context, ICLTensor *input, ICLTensor *output, int axis, float epsilon = 1e-12f); /** Static function to check if given info will lead to a valid configuration of @ref CLL2NormalizeLayer. * @@ -84,10 +107,10 @@ public: void run() override; private: - MemoryGroup _memory_group; - CLReductionOperation _reduce_func; - CLL2NormalizeLayerKernel _normalize_kernel; - CLTensor _sumsq; + MemoryGroup _memory_group; + CLReductionOperation _reduce_func; + std::unique_ptr<CLL2NormalizeLayerKernel> _normalize_kernel; + CLTensor _sumsq; }; -} +} // namespace arm_compute #endif /*ARM_COMPUTE_CLL2NORMALIZELAYER_H */ |