diff options
author | Sang-Hoon Park <sang-hoon.park@arm.com> | 2019-10-15 16:49:24 +0100 |
---|---|---|
committer | Sang-Hoon Park <sang-hoon.park@arm.com> | 2019-10-30 14:49:34 +0000 |
commit | 2697fd8fa42425f7bfdd60dd486d4c2132b06523 (patch) | |
tree | 098450f7f60211c7e5bfbd41eb1a7a10c1c0437f /src/runtime/NEON/functions/NEArgMinMaxLayer.cpp | |
parent | df4cf57c7394265b27d051cb1cf0152c53659126 (diff) | |
download | ComputeLibrary-2697fd8fa42425f7bfdd60dd486d4c2132b06523.tar.gz |
COMPMID-2707: add keep_dims parameter to Reduction Operation
The added parameter is used to decide whether or not to keep
the target dimension of reduction operation. ArgMinMax operations
will always remove the reduced dimension. Following things
are updated to support the parameter.
- [CL/NEON] functions and reference kernel
- [CL/NEON] ArgMinMax function to use ReductionOperation function
- [CL/NEON] validation test suite for Reduction and ArgMinMax operations
to validate the added parameter
- ReductionOperationFixture is modified NOT to pre-populate output
tensor and now relies on underlying kernel/function.
- Adjust CL validation test suite for Reduction operation to remove
excessive test cases with axis values beyond input tensor's
dimension.
Change-Id: I3e24d276ed469a4201f323001708f0c525f11c4f
Signed-off-by: Sang-Hoon Park <sang-hoon.park@arm.com>
Reviewed-on: https://review.mlplatform.org/c/2167
Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Tested-by: Arm Jenkins <bsgcomp@arm.com>
Reviewed-by: Michele Di Giorgio <michele.digiorgio@arm.com>
Reviewed-by: Georgios Pinitas <georgios.pinitas@arm.com>
Diffstat (limited to 'src/runtime/NEON/functions/NEArgMinMaxLayer.cpp')
-rw-r--r-- | src/runtime/NEON/functions/NEArgMinMaxLayer.cpp | 24 |
1 files changed, 6 insertions, 18 deletions
diff --git a/src/runtime/NEON/functions/NEArgMinMaxLayer.cpp b/src/runtime/NEON/functions/NEArgMinMaxLayer.cpp index 6863bb0b3b..ab2d6f0c1f 100644 --- a/src/runtime/NEON/functions/NEArgMinMaxLayer.cpp +++ b/src/runtime/NEON/functions/NEArgMinMaxLayer.cpp @@ -23,47 +23,35 @@ */ #include "arm_compute/runtime/NEON/functions/NEArgMinMaxLayer.h" +#include "arm_compute/runtime/NEON/functions/NEReductionOperation.h" #include "arm_compute/core/Error.h" #include "arm_compute/core/ITensor.h" #include "arm_compute/core/TensorInfo.h" #include "arm_compute/core/Types.h" #include "arm_compute/core/Validate.h" -#include "arm_compute/runtime/NEON/NEScheduler.h" namespace arm_compute { NEArgMinMaxLayer::NEArgMinMaxLayer(std::shared_ptr<IMemoryManager> memory_manager) - : _memory_group(std::move(memory_manager)), _reduction_kernel(), _fill_border_kernel(), _run_fill_border(false) + : _reduction_function(support::cpp14::make_unique<NEReductionOperation>()) { + ARM_COMPUTE_UNUSED(memory_manager); } void NEArgMinMaxLayer::configure(ITensor *input, int axis, ITensor *output, const ReductionOperation &op) { - _reduction_kernel.configure(input, output, axis, op); - - if(axis == 0) - { - _fill_border_kernel.configure(input, _reduction_kernel.border_size(), BorderMode::REPLICATE); - _run_fill_border = true; - } + _reduction_function->configure(input, output, axis, op, false); } Status NEArgMinMaxLayer::validate(const ITensorInfo *input, int axis, const ITensorInfo *output, const ReductionOperation &op) { ARM_COMPUTE_RETURN_ERROR_ON_MSG(op != ReductionOperation::ARG_IDX_MAX && op != ReductionOperation::ARG_IDX_MIN, "Invalid operation"); - ARM_COMPUTE_RETURN_ON_ERROR(NEReductionOperationKernel::validate(input, output, axis, op)); - return Status{}; + return NEReductionOperation::validate(input, output, axis, op, false); } void NEArgMinMaxLayer::run() { - MemoryGroupResourceScope scope_mg(_memory_group); - - if(_run_fill_border) - { - NEScheduler::get().schedule(&_fill_border_kernel, Window::DimY); - } - NEScheduler::get().schedule(&_reduction_kernel, Window::DimY); + _reduction_function->run(); } } // namespace arm_compute
\ No newline at end of file |