aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/CL/functions/CLTranspose.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/runtime/CL/functions/CLTranspose.cpp')
-rw-r--r--src/runtime/CL/functions/CLTranspose.cpp39
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..5a738f47ce 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 "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"
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
+} // namespace arm_compute