diff options
Diffstat (limited to 'src/runtime/CL/functions/CLTranspose.cpp')
-rw-r--r-- | src/runtime/CL/functions/CLTranspose.cpp | 43 |
1 files changed, 34 insertions, 9 deletions
diff --git a/src/runtime/CL/functions/CLTranspose.cpp b/src/runtime/CL/functions/CLTranspose.cpp index f5121d06a5..5a738f47ce 100644 --- a/src/runtime/CL/functions/CLTranspose.cpp +++ b/src/runtime/CL/functions/CLTranspose.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2020 ARM Limited. + * Copyright (c) 2017-2021 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -23,12 +23,26 @@ */ #include "arm_compute/runtime/CL/functions/CLTranspose.h" -#include "arm_compute/core/CL/kernels/CLTransposeKernel.h" -#include "support/MemorySupport.h" +#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 <utility> +#include "src/core/CL/ICLKernel.h" +#include "src/gpu/cl/operators/ClTranspose.h" -using namespace arm_compute; +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) { @@ -37,12 +51,23 @@ void CLTranspose::configure(const ICLTensor *input, ICLTensor *output) void CLTranspose::configure(const CLCompileContext &compile_context, const ICLTensor *input, ICLTensor *output) { - auto k = arm_compute::support::cpp14::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 |