aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/NEON/functions/NETranspose.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/runtime/NEON/functions/NETranspose.cpp')
-rw-r--r--src/runtime/NEON/functions/NETranspose.cpp43
1 files changed, 35 insertions, 8 deletions
diff --git a/src/runtime/NEON/functions/NETranspose.cpp b/src/runtime/NEON/functions/NETranspose.cpp
index aaa52e36b9..3b3023f3b3 100644
--- a/src/runtime/NEON/functions/NETranspose.cpp
+++ b/src/runtime/NEON/functions/NETranspose.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017-2020 Arm Limited.
+ * Copyright (c) 2017-2021 Arm Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -23,21 +23,48 @@
*/
#include "arm_compute/runtime/NEON/functions/NETranspose.h"
-#include "src/core/NEON/kernels/NETransposeKernel.h"
-
-#include <utility>
+#include "arm_compute/core/Validate.h"
+#include "src/runtime/cpu/operators/CpuTranspose.h"
namespace arm_compute
{
+struct NETranspose::Impl
+{
+ const ITensor *src{ nullptr };
+ ITensor *dst{ nullptr };
+ std::unique_ptr<cpu::CpuTranspose> op{ nullptr };
+};
+
+NETranspose::NETranspose()
+ : _impl(std::make_unique<Impl>())
+{
+}
+
+NETranspose::~NETranspose() = default;
+
void NETranspose::configure(const ITensor *input, ITensor *output)
{
- auto k = std::make_unique<NETransposeKernel>();
- k->configure(input, output);
- _kernel = std::move(k);
+ ARM_COMPUTE_ERROR_ON_NULLPTR(input, output);
+
+ _impl->src = input;
+ _impl->dst = output;
+ _impl->op = std::make_unique<cpu::CpuTranspose>();
+ _impl->op->configure(input->info(), output->info());
}
Status NETranspose::validate(const ITensorInfo *input, const ITensorInfo *output)
{
- return NETransposeKernel::validate(input, output);
+ ARM_COMPUTE_RETURN_ERROR_ON_NULLPTR(input, output);
+ ARM_COMPUTE_RETURN_ON_ERROR(cpu::CpuTranspose::validate(input, output));
+ return Status{};
+}
+
+void NETranspose::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