From bcd2352d7fd99a2f6aab220fa0c3b3f3119a1a4c Mon Sep 17 00:00:00 2001 From: Michalis Spyrou Date: Thu, 21 May 2020 15:02:36 +0100 Subject: COMPMID-3391: Implement Async interfaces Change-Id: I8168cea5056ff48a0253ebb8c88ea549a3ea69a2 Signed-off-by: Michalis Spyrou Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/3335 Tested-by: Arm Jenkins Comments-Addressed: Arm Jenkins Reviewed-by: Georgios Pinitas --- src/core/NEON/kernels/NEReshapeLayerKernel.cpp | 45 +++++++++++++------------- 1 file changed, 22 insertions(+), 23 deletions(-) (limited to 'src/core/NEON/kernels/NEReshapeLayerKernel.cpp') 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 /** [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 &inputs, std::vector &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(window, _input, _output); + reshape_tensor(window, inputs[0]->second, outputs[0]->second); break; case DataType::U16: case DataType::S16: case DataType::F16: - reshape_tensor(window, _input, _output); + reshape_tensor(window, inputs[0]->second, outputs[0]->second); break; case DataType::U32: case DataType::S32: case DataType::F32: - reshape_tensor(window, _input, _output); + reshape_tensor(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] **/ -- cgit v1.2.1