From 2788609b8a10306e9eae47543b39812a7b075aaa Mon Sep 17 00:00:00 2001 From: Teresa Charlin Date: Thu, 25 Feb 2021 20:15:01 +0000 Subject: Port ClTranspose to new API Partially Resolves: COMPMID-4277 (1/2) Signed-off-by: Teresa Charlin Change-Id: I704c2303135cbe1ba46d2fd5642c84c562204bc7 Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/5194 Tested-by: Arm Jenkins Reviewed-by: Georgios Pinitas Comments-Addressed: Arm Jenkins --- arm_compute/runtime/CL/functions/CLTranspose.h | 33 +++++++++++++++++++------- 1 file changed, 25 insertions(+), 8 deletions(-) (limited to 'arm_compute/runtime/CL/functions/CLTranspose.h') diff --git a/arm_compute/runtime/CL/functions/CLTranspose.h b/arm_compute/runtime/CL/functions/CLTranspose.h index 2b7a03f23f..43cebeba90 100644 --- a/arm_compute/runtime/CL/functions/CLTranspose.h +++ b/arm_compute/runtime/CL/functions/CLTranspose.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2020 Arm Limited. + * Copyright (c) 2017-2021 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -25,7 +25,9 @@ #define ARM_COMPUTE_CLTRANSPOSE_H #include "arm_compute/core/Error.h" -#include "arm_compute/runtime/CL/ICLSimpleFunction.h" +#include "arm_compute/runtime/IFunction.h" + +#include namespace arm_compute { @@ -33,14 +35,22 @@ class CLCompileContext; class ICLTensor; class ITensorInfo; -/** Basic function to transpose a matrix on OpenCL. This function calls the following OpenCL kernel: - * - * -# @ref CLTransposeKernel - * - */ -class CLTranspose : public ICLSimpleFunction +/** Basic function to execute an @ref opencl::kernels::ClTransposeKernel. */ +class CLTranspose : public IFunction { public: + /** Constructor */ + CLTranspose(); + /** Destructor */ + ~CLTranspose(); + /** Prevent instances of this class from being copied (As this class contains pointers) */ + CLTranspose(const CLTranspose &) = delete; + /** Default move constructor */ + CLTranspose(CLTranspose &&) = default; + /** Prevent instances of this class from being copied (As this class contains pointers) */ + CLTranspose &operator=(const CLTranspose &) = delete; + /** Default move assignment operator */ + CLTranspose &operator=(CLTranspose &&) = default; /** Initialise the kernel's inputs and output * * @param[in] input Input tensor. Data types supported: All. @@ -62,6 +72,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; }; } -- cgit v1.2.1