diff options
author | Teresa Charlin <teresa.charlinreyes@arm.com> | 2021-02-25 20:15:01 +0000 |
---|---|---|
committer | Georgios Pinitas <georgios.pinitas@arm.com> | 2021-03-29 20:23:11 +0000 |
commit | 2788609b8a10306e9eae47543b39812a7b075aaa (patch) | |
tree | 81515046e0c06d6a21ecdcebfe083ea5922fea0c /src/runtime/CL/functions/CLTranspose.cpp | |
parent | f9a611a1fd309bb9a906c99eede5e6b7bceba26b (diff) | |
download | ComputeLibrary-2788609b8a10306e9eae47543b39812a7b075aaa.tar.gz |
Port ClTranspose to new API
Partially Resolves: COMPMID-4277 (1/2)
Signed-off-by: Teresa Charlin <teresa.charlinreyes@arm.com>
Change-Id: I704c2303135cbe1ba46d2fd5642c84c562204bc7
Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/5194
Tested-by: Arm Jenkins <bsgcomp@arm.com>
Reviewed-by: Georgios Pinitas <georgios.pinitas@arm.com>
Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'src/runtime/CL/functions/CLTranspose.cpp')
-rw-r--r-- | src/runtime/CL/functions/CLTranspose.cpp | 39 |
1 files changed, 32 insertions, 7 deletions
diff --git a/src/runtime/CL/functions/CLTranspose.cpp b/src/runtime/CL/functions/CLTranspose.cpp index 67151be9a1..142cf73259 100644 --- a/src/runtime/CL/functions/CLTranspose.cpp +++ b/src/runtime/CL/functions/CLTranspose.cpp @@ -23,12 +23,27 @@ */ #include "arm_compute/runtime/CL/functions/CLTranspose.h" -#include "src/core/CL/kernels/CLTransposeKernel.h" - -#include <utility> +#include "arm_compute/core/CL/CLKernelLibrary.h" +#include "arm_compute/core/CL/ICLTensor.h" +#include "arm_compute/core/Types.h" +#include "arm_compute/core/Validate.h" +#include "src/core/CL/ICLKernel.h" +#include "src/runtime/gpu/cl/operators/ClTranspose.h" namespace arm_compute { +struct CLTranspose::Impl +{ + const ICLTensor *src{ nullptr }; + ICLTensor *dst{ nullptr }; + std::unique_ptr<opencl::ClTranspose> op{ nullptr }; +}; +CLTranspose::CLTranspose() + : _impl(std::make_unique<Impl>()) +{ +} +CLTranspose::~CLTranspose() = default; + void CLTranspose::configure(const ICLTensor *input, ICLTensor *output) { configure(CLKernelLibrary::get().get_compile_context(), input, output); @@ -36,13 +51,23 @@ void CLTranspose::configure(const ICLTensor *input, ICLTensor *output) void CLTranspose::configure(const CLCompileContext &compile_context, const ICLTensor *input, ICLTensor *output) { - auto k = std::make_unique<CLTransposeKernel>(); - k->configure(compile_context, input, output); - _kernel = std::move(k); + ARM_COMPUTE_ERROR_ON_NULLPTR(input, output); + _impl->src = input; + _impl->dst = output; + _impl->op = std::make_unique<opencl::ClTranspose>(); + _impl->op->configure(compile_context, _impl->src->info(), _impl->dst->info()); } Status CLTranspose::validate(const ITensorInfo *input, const ITensorInfo *output) { - return CLTransposeKernel::validate(input, output); + return opencl::ClTranspose::validate(input, output); +} + +void CLTranspose::run() +{ + ITensorPack pack; + pack.add_tensor(TensorType::ACL_SRC, _impl->src); + pack.add_tensor(TensorType::ACL_DST, _impl->dst); + _impl->op->run(pack); } } // namespace arm_compute
\ No newline at end of file |