diff options
author | Michele Di Giorgio <michele.digiorgio@arm.com> | 2021-02-01 17:09:32 +0000 |
---|---|---|
committer | Georgios Pinitas <georgios.pinitas@arm.com> | 2021-02-03 18:40:52 +0000 |
commit | e1314665fcfd2a32d6117a8fc16f67a83db3bb05 (patch) | |
tree | 63c72e418093bbd57a7e07e8791a9af4faa8ca8b /arm_compute/runtime/CL | |
parent | be9f9f9139b759d314f4f2a6d2ee747079666504 (diff) | |
download | ComputeLibrary-e1314665fcfd2a32d6117a8fc16f67a83db3bb05.tar.gz |
Make CL Pooling kernels and functions state-less
Resolves COMPMID-4000
Change-Id: I64878f93c033b4928fdefbb964c37c67fdecfaab
Signed-off-by: Michele Di Giorgio <michele.digiorgio@arm.com>
Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/4971
Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Tested-by: Arm Jenkins <bsgcomp@arm.com>
Reviewed-by: Manuel Bottini <manuel.bottini@arm.com>
Reviewed-by: Georgios Pinitas <georgios.pinitas@arm.com>
Diffstat (limited to 'arm_compute/runtime/CL')
-rw-r--r-- | arm_compute/runtime/CL/functions/CLPoolingLayer.h | 34 |
1 files changed, 25 insertions, 9 deletions
diff --git a/arm_compute/runtime/CL/functions/CLPoolingLayer.h b/arm_compute/runtime/CL/functions/CLPoolingLayer.h index ef1f426c22..ec1c4eb768 100644 --- a/arm_compute/runtime/CL/functions/CLPoolingLayer.h +++ b/arm_compute/runtime/CL/functions/CLPoolingLayer.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2020 Arm Limited. + * Copyright (c) 2017-2021 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -24,25 +24,34 @@ #ifndef ARM_COMPUTE_CLPOOLINGLAYER_H #define ARM_COMPUTE_CLPOOLINGLAYER_H -#include "arm_compute/runtime/CL/ICLSimpleFunction.h" +#include "arm_compute/runtime/IFunction.h" -#include "arm_compute/core/Error.h" #include "arm_compute/core/Types.h" +#include <memory> + namespace arm_compute { class CLCompileContext; class ICLTensor; class ITensorInfo; -/** Basic function to simulate a pooling layer with the specified pooling operation. This function calls the following OpenCL kernels: - * - * -# @ref CLFillBorderKernel (executed if padding size is different from zero) - * -# @ref CLPoolingLayerKernel - */ -class CLPoolingLayer : public ICLSimpleFunction +/** Basic function to run @ref opencl::ClPooling */ +class CLPoolingLayer : public IFunction { public: + /** Default Constructor */ + CLPoolingLayer(); + /** Default Destructor */ + ~CLPoolingLayer(); + /** Prevent instances of this class from being copied (As this class contains pointers) */ + CLPoolingLayer(const CLPoolingLayer &) = delete; + /** Default move constructor */ + CLPoolingLayer(CLPoolingLayer &&) = default; + /** Prevent instances of this class from being copied (As this class contains pointers) */ + CLPoolingLayer &operator=(const CLPoolingLayer &) = delete; + /** Default move assignment operator */ + CLPoolingLayer &operator=(CLPoolingLayer &&) = default; /** Set the input and output tensors. * * @param[in,out] input Source tensor. (Written to only when padding != 0) Data types supported: QASYMM8/QASYMM8_SIGNED/F16/F32. @@ -70,6 +79,13 @@ public: * @return a status */ static Status validate(const ITensorInfo *input, const ITensorInfo *output, const PoolingLayerInfo &pool_info, const ITensorInfo *indices = nullptr); + + // Inherited methods overridden: + void run() override; + +private: + struct Impl; + std::unique_ptr<Impl> _impl; }; } // namespace arm_compute #endif /* ARM_COMPUTE_CLPOOLINGLAYER_H */ |