aboutsummaryrefslogtreecommitdiff
path: root/src/core/NEON/kernels/NEReshapeLayerKernel.cpp
diff options
context:
space:
mode:
authorMichalis Spyrou <michalis.spyrou@arm.com>2020-05-21 15:02:36 +0100
committerGeorgios Pinitas <georgios.pinitas@arm.com>2020-06-16 11:42:09 +0000
commitbcd2352d7fd99a2f6aab220fa0c3b3f3119a1a4c (patch)
treea3e1880071bca828b1c58be71805ccce4b205e53 /src/core/NEON/kernels/NEReshapeLayerKernel.cpp
parenteae658453199d67a41deccbeb78e55b8eea9e966 (diff)
downloadComputeLibrary-bcd2352d7fd99a2f6aab220fa0c3b3f3119a1a4c.tar.gz
COMPMID-3391: Implement Async interfaces
Change-Id: I8168cea5056ff48a0253ebb8c88ea549a3ea69a2 Signed-off-by: Michalis Spyrou <michalis.spyrou@arm.com> Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/3335 Tested-by: Arm Jenkins <bsgcomp@arm.com> Comments-Addressed: Arm Jenkins <bsgcomp@arm.com> Reviewed-by: Georgios Pinitas <georgios.pinitas@arm.com>
Diffstat (limited to 'src/core/NEON/kernels/NEReshapeLayerKernel.cpp')
-rw-r--r--src/core/NEON/kernels/NEReshapeLayerKernel.cpp45
1 files changed, 22 insertions, 23 deletions
diff --git a/src/core/NEON/kernels/NEReshapeLayerKernel.cpp b/src/core/NEON/kernels/NEReshapeLayerKernel.cpp
index 53fcfd724d..600f8f9bf1 100644
--- a/src/core/NEON/kernels/NEReshapeLayerKernel.cpp
+++ b/src/core/NEON/kernels/NEReshapeLayerKernel.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017-2019 ARM Limited.
+ * Copyright (c) 2017-2020 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -31,13 +31,14 @@
#include "arm_compute/core/ITensor.h"
#include "arm_compute/core/NEON/INEKernel.h"
#include "arm_compute/core/TensorInfo.h"
+#include "arm_compute/core/Types.h"
#include "arm_compute/core/Validate.h"
#include <cstdint>
/** [NEReshapeLayerKernel Kernel] **/
-using namespace arm_compute;
-
+namespace arm_compute
+{
namespace
{
Status validate_arguments(const ITensorInfo *input, const ITensorInfo *output)
@@ -71,56 +72,54 @@ inline void reshape_tensor(const Window &window, const ITensor *input, ITensor *
}
} // namespace
-void NEReshapeLayerKernel::configure(const ITensor *input, ITensor *output)
+void NEReshapeLayerKernel::configure(const ITensorInfo *input, ITensorInfo *output)
{
ARM_COMPUTE_ERROR_ON_NULLPTR(input, output);
- ARM_COMPUTE_ERROR_THROW_ON(validate_arguments(input->info(), output->info()));
-
- _input = input;
- _output = output;
+ ARM_COMPUTE_ERROR_THROW_ON(validate_arguments(input, output));
// Configure kernel window
- Window win = calculate_max_window(*input->info());
+ Window win = calculate_max_window(*input);
// Set the output valid region
- output->info()->set_valid_region(ValidRegion(Coordinates(), output->info()->tensor_shape()));
+ output->set_valid_region(ValidRegion(Coordinates(), output->tensor_shape()));
INEKernel::configure(win);
}
-Status NEReshapeLayerKernel::validate(const ITensorInfo *input, const ITensorInfo *output)
-{
- ARM_COMPUTE_RETURN_ON_ERROR(validate_arguments(input, output));
-
- return Status{};
-}
-
-void NEReshapeLayerKernel::run(const Window &window, const ThreadInfo &info)
+void NEReshapeLayerKernel::run_op(const std::vector<InputOperatorTensors *> &inputs, std::vector<OutputOperatorTensors *> &outputs, const Window &window, const ThreadInfo &info)
{
ARM_COMPUTE_UNUSED(info);
ARM_COMPUTE_ERROR_ON_UNCONFIGURED_KERNEL(this);
- ARM_COMPUTE_ERROR_ON_INVALID_SUBWINDOW(INESimpleKernel::window(), window);
+ ARM_COMPUTE_ERROR_ON_INVALID_SUBWINDOW(INEKernel::window(), window);
- switch(_input->info()->data_type())
+ switch(inputs[0]->second->info()->data_type())
{
case DataType::U8:
case DataType::S8:
case DataType::QASYMM8:
case DataType::QASYMM8_SIGNED:
- reshape_tensor<uint8_t>(window, _input, _output);
+ reshape_tensor<uint8_t>(window, inputs[0]->second, outputs[0]->second);
break;
case DataType::U16:
case DataType::S16:
case DataType::F16:
- reshape_tensor<uint16_t>(window, _input, _output);
+ reshape_tensor<uint16_t>(window, inputs[0]->second, outputs[0]->second);
break;
case DataType::U32:
case DataType::S32:
case DataType::F32:
- reshape_tensor<uint32_t>(window, _input, _output);
+ reshape_tensor<uint32_t>(window, inputs[0]->second, outputs[0]->second);
break;
default:
ARM_COMPUTE_ERROR("Unsupported data type!");
}
}
+
+Status NEReshapeLayerKernel::validate(const ITensorInfo *input, const ITensorInfo *output)
+{
+ ARM_COMPUTE_RETURN_ON_ERROR(validate_arguments(input, output));
+
+ return Status{};
+}
+} // namespace arm_compute
/** [NEReshapeLayerKernel Kernel] **/