diff options
author | Manuel Bottini <manuel.bottini@arm.com> | 2021-03-01 17:39:36 +0000 |
---|---|---|
committer | Manuel Bottini <manuel.bottini@arm.com> | 2021-03-10 15:45:16 +0000 |
commit | 5a1bf629752720a7ba0c88f34249393f7e52ad3c (patch) | |
tree | 558391e00c108062b77983eede729863fdceccf1 /arm_compute/runtime/CL | |
parent | 0ded4c40578bc78003756d171f2bbe15f6ac72bc (diff) | |
download | ComputeLibrary-5a1bf629752720a7ba0c88f34249393f7e52ad3c.tar.gz |
Port OpenCL Quantization to new API
Partially resolves: COMPMID-4193
Change-Id: Ie8367769c690442a0e30383c67851b50ab7c6742
Signed-off-by: Manuel Bottini <manuel.bottini@arm.com>
Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/5231
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/CL')
-rw-r--r-- | arm_compute/runtime/CL/functions/CLGenerateProposalsLayer.h | 6 | ||||
-rw-r--r-- | arm_compute/runtime/CL/functions/CLQuantizationLayer.h | 33 |
2 files changed, 30 insertions, 9 deletions
diff --git a/arm_compute/runtime/CL/functions/CLGenerateProposalsLayer.h b/arm_compute/runtime/CL/functions/CLGenerateProposalsLayer.h index 4d6bc66487..e6b0eed6d8 100644 --- a/arm_compute/runtime/CL/functions/CLGenerateProposalsLayer.h +++ b/arm_compute/runtime/CL/functions/CLGenerateProposalsLayer.h @@ -43,7 +43,7 @@ class CLBoundingBoxTransformKernel; class CLDequantizationLayerKernel; class CLComputeAllAnchorsKernel; class CLPadLayerKernel; -class CLQuantizationLayerKernel; +class CLQuantizationLayer; class ICLTensor; class ITensorInfo; @@ -56,7 +56,7 @@ class ITensorInfo; * -# @ref CLBoundingBoxTransform * -# @ref CLPadLayerKernel * -# @ref CLDequantizationLayerKernel x 2 - * -# @ref CLQuantizationLayerKernel + * -# @ref CLQuantizationLayer * And the following CPP functions: * -# @ref CPPBoxWithNonMaximaSuppressionLimit */ @@ -146,7 +146,7 @@ private: std::unique_ptr<CLPadLayerKernel> _pad_kernel; std::unique_ptr<CLDequantizationLayerKernel> _dequantize_anchors; std::unique_ptr<CLDequantizationLayerKernel> _dequantize_deltas; - std::unique_ptr<CLQuantizationLayerKernel> _quantize_all_proposals; + std::unique_ptr<CLQuantizationLayer> _quantize_all_proposals; // CPP functions CPPBoxWithNonMaximaSuppressionLimit _cpp_nms; diff --git a/arm_compute/runtime/CL/functions/CLQuantizationLayer.h b/arm_compute/runtime/CL/functions/CLQuantizationLayer.h index a0a27c5cb4..c5dad53513 100644 --- a/arm_compute/runtime/CL/functions/CLQuantizationLayer.h +++ b/arm_compute/runtime/CL/functions/CLQuantizationLayer.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2020 Arm Limited. + * Copyright (c) 2017-2021 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -24,8 +24,10 @@ #ifndef ARM_COMPUTE_CLQUANTIZATIONLAYER_H #define ARM_COMPUTE_CLQUANTIZATIONLAYER_H -#include "arm_compute/core/Error.h" -#include "arm_compute/runtime/CL/ICLSimpleFunction.h" +#include "arm_compute/core/Types.h" +#include "arm_compute/runtime/IFunction.h" + +#include <memory> namespace arm_compute { @@ -35,14 +37,26 @@ class ITensorInfo; /** Basic function to simulate a quantization layer. This function calls the following CL kernels: * - * @note The implementation supports only 3D input tensors. + * -# @ref opencl::ClQuantization * - * -# @ref CLQuantizationLayerKernel + * @note The implementation supports only 3D input tensors. * */ -class CLQuantizationLayer : public ICLSimpleFunction +class CLQuantizationLayer : public IFunction { public: + /** Default Constructor */ + CLQuantizationLayer(); + /** Default Destructor */ + ~CLQuantizationLayer(); + /** Prevent instances of this class from being copied (As this class contains pointers) */ + CLQuantizationLayer(const CLQuantizationLayer &) = delete; + /** Default move constructor */ + CLQuantizationLayer(CLQuantizationLayer &&) = default; + /** Prevent instances of this class from being copied (As this class contains pointers) */ + CLQuantizationLayer &operator=(const CLQuantizationLayer &) = delete; + /** Default move assignment operator */ + CLQuantizationLayer &operator=(CLQuantizationLayer &&) = default; /** Set the input and output tensors. * * @param[in] input Source tensor. The dimensions over the third will be interpreted as batches. Data types supported: QASYMM8/QASYMM8_SIGNED/F16/32. @@ -68,6 +82,13 @@ public: * @return a status */ static Status validate(const ITensorInfo *input, const ITensorInfo *output); + + // Inherited methods overridden: + void run() override; + +private: + struct Impl; + std::unique_ptr<Impl> _impl; }; } //namespace arm_compute #endif /* ARM_COMPUTE_CLQUANTIZATIONLAYER_H */ |