From 4667dddc0ed403c636348294cd7f70261e5540cf Mon Sep 17 00:00:00 2001 From: Georgios Pinitas Date: Mon, 13 Jul 2020 21:21:33 +0100 Subject: COMPMID-3374: Remove memory state from NEConcatenateLayer kernels * Allow the following kernels to accept backing memory at run-time: * NEBatchConcatenateLayerKernel * NEDepthConcatenateLayerKernel * NEHeightConcatenateLayerKernel * NEWidthConcatenateLayerKernel * Allow the following functions to accept backing memory at run-time: * NEConcatenateLayer Signed-off-by: Georgios Pinitas Change-Id: Ib0b6714cff7f06a52dc74d294bc3e0d72a1c2419 Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/3569 Tested-by: Arm Jenkins Reviewed-by: Michalis Spyrou Comments-Addressed: Arm Jenkins --- .../NEON/kernels/NEDepthConcatenateLayerKernel.cpp | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) (limited to 'src/core/NEON/kernels/NEDepthConcatenateLayerKernel.cpp') diff --git a/src/core/NEON/kernels/NEDepthConcatenateLayerKernel.cpp b/src/core/NEON/kernels/NEDepthConcatenateLayerKernel.cpp index a95d711f43..49e10de94e 100644 --- a/src/core/NEON/kernels/NEDepthConcatenateLayerKernel.cpp +++ b/src/core/NEON/kernels/NEDepthConcatenateLayerKernel.cpp @@ -142,21 +142,19 @@ Status validate_arguments(const ITensorInfo *input, unsigned int depth_offset, c } // namespace NEDepthConcatenateLayerKernel::NEDepthConcatenateLayerKernel() - : _func(nullptr), _input(nullptr), _output(nullptr), _depth_offset(0) + : _func(nullptr), _depth_offset(0) { } -void NEDepthConcatenateLayerKernel::configure(const ITensor *input, unsigned int depth_offset, ITensor *output) +void NEDepthConcatenateLayerKernel::configure(const ITensorInfo *input, unsigned int depth_offset, ITensorInfo *output) { ARM_COMPUTE_ERROR_ON_NULLPTR(input, output); - ARM_COMPUTE_ERROR_THROW_ON(validate_arguments(input->info(), depth_offset, output->info())); + ARM_COMPUTE_ERROR_THROW_ON(validate_arguments(input, depth_offset, output)); _func = nullptr; - _input = input; - _output = output; _depth_offset = depth_offset; - switch(input->info()->data_type()) + switch(input->data_type()) { case DataType::QASYMM8: _func = &depth_concat; @@ -175,11 +173,11 @@ void NEDepthConcatenateLayerKernel::configure(const ITensor *input, unsigned int } // Configure kernel window - Window win = calculate_max_window(*output->info(), Steps()); + Window win = calculate_max_window(*output, Steps()); Coordinates coord; - coord.set_num_dimensions(output->info()->num_dimensions()); + coord.set_num_dimensions(output->num_dimensions()); - output->info()->set_valid_region(ValidRegion(coord, output->info()->tensor_shape())); + output->set_valid_region(ValidRegion(coord, output->tensor_shape())); INEKernel::configure(win); } @@ -191,13 +189,14 @@ Status NEDepthConcatenateLayerKernel::validate(const arm_compute::ITensorInfo *i return Status{}; } -void NEDepthConcatenateLayerKernel::run(const Window &window, const ThreadInfo &info) +void NEDepthConcatenateLayerKernel::run_op(const InputTensorMap &inputs, const OutputTensorMap &outputs, + const Window &window, const ThreadInfo &info) { ARM_COMPUTE_UNUSED(info); ARM_COMPUTE_ERROR_ON_UNCONFIGURED_KERNEL(this); ARM_COMPUTE_ERROR_ON_INVALID_SUBWINDOW(INEKernel::window(), window); ARM_COMPUTE_ERROR_ON(_func == nullptr); - (*_func)(_input, _output, _depth_offset, window); + (*_func)(inputs.at(TensorType::ACL_SRC), outputs.at(TensorType::ACL_DST), _depth_offset, window); } } // namespace arm_compute -- cgit v1.2.1