From 91b7f7423a97f0ae713a13182f289621dad17c43 Mon Sep 17 00:00:00 2001 From: Teresa Charlin Date: Mon, 12 Apr 2021 13:57:00 +0100 Subject: Port CLConvertFullyConnectedWeights to new API * Replace ICLKernel by IClKernel in other unrelated kernels Resolves partially: COMPMID-4187 Signed-off-by: Teresa Charlin Change-Id: I173b8f2ac645dbfd7d412f4b058c5c9655c229ee Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/5402 Reviewed-by: Michele Di Giorgio Tested-by: Arm Jenkins Comments-Addressed: Arm Jenkins --- .../CL/functions/CLConvertFullyConnectedWeights.h | 32 ++++++++++++++++++---- 1 file changed, 26 insertions(+), 6 deletions(-) (limited to 'arm_compute/runtime') diff --git a/arm_compute/runtime/CL/functions/CLConvertFullyConnectedWeights.h b/arm_compute/runtime/CL/functions/CLConvertFullyConnectedWeights.h index 75a3d3213e..8892dbad6c 100644 --- a/arm_compute/runtime/CL/functions/CLConvertFullyConnectedWeights.h +++ b/arm_compute/runtime/CL/functions/CLConvertFullyConnectedWeights.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2020 Arm Limited. + * Copyright (c) 2018-2021 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -26,20 +26,33 @@ #include "arm_compute/core/CL/CLKernelLibrary.h" #include "arm_compute/runtime/CL/CLTensor.h" -#include "arm_compute/runtime/CL/ICLSimpleFunction.h" +#include "arm_compute/runtime/IFunction.h" #include "arm_compute/runtime/ITransformWeights.h" +#include + namespace arm_compute { class CLCompileContext; -class CLConvertFullyConnectedWeightsKernel; class ICLTensor; class ITensorInfo; -/** Basic function to run @ref CLConvertFullyConnectedWeightsKernel. */ -class CLConvertFullyConnectedWeights : public ICLSimpleFunction +/** Basic function to run an @ref opencl::kernels::ClConvertFullyConnectedWeightsKernel. */ +class CLConvertFullyConnectedWeights : public IFunction { public: + /** Constructor */ + CLConvertFullyConnectedWeights(); + /** Destructor */ + ~CLConvertFullyConnectedWeights(); + /** Prevent instances of this class from being copied (As this class contains pointers) */ + CLConvertFullyConnectedWeights(const CLConvertFullyConnectedWeights &) = delete; + /** Default move constructor */ + CLConvertFullyConnectedWeights(CLConvertFullyConnectedWeights &&) = default; + /** Prevent instances of this class from being copied (As this class contains pointers) */ + CLConvertFullyConnectedWeights &operator=(const CLConvertFullyConnectedWeights &) = delete; + /** Default move assignment operator */ + CLConvertFullyConnectedWeights &operator=(CLConvertFullyConnectedWeights &&) = default; /** Initialize the function. * * @param[in] input Source weights tensor to convert. Must be 2 dimensional. Data types supported: All. @@ -69,11 +82,18 @@ public: * @param[in] data_layout The data layout the weights have been trained in. */ static Status validate(const ITensorInfo *input, const ITensorInfo *output, const TensorShape &original_input_shape, DataLayout data_layout); + + // Inherited methods overridden: + void run() override; + +private: + struct Impl; + std::unique_ptr _impl; }; namespace weights_transformations { -/** Basic function to run @ref CLConvertFullyConnectedWeightsKernel. */ +/** Basic function to manage @ref CLConvertFullyConnectedWeights. */ class CLConvertFullyConnectedWeightsManaged : public ITransformWeights { public: -- cgit v1.2.1