diff options
author | Manuel Bottini <manuel.bottini@arm.com> | 2020-04-08 10:15:51 +0100 |
---|---|---|
committer | Manuel Bottini <manuel.bottini@arm.com> | 2020-04-23 17:53:59 +0000 |
commit | 2b84be544e4a27f7e8e80827e9c85c8f0d58b4ce (patch) | |
tree | 078051a911f9b8883a3f11955cfd3b7ba0d7d9f3 /src/runtime/CL/functions/CLReductionOperation.cpp | |
parent | 0de45d0a8009e19331c4e29d617fa183167c513a (diff) | |
download | ComputeLibrary-2b84be544e4a27f7e8e80827e9c85c8f0d58b4ce.tar.gz |
COMPMID-3280: Make all ML primitives for CL use the new interface - Part 2
- CLFunctions have been updated
Change-Id: Ie3256a6c775bc12f3126482bd8e8a46da54b267c
Signed-off-by: Manuel Bottini <manuel.bottini@arm.com>
Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/3053
Reviewed-by: Georgios Pinitas <georgios.pinitas@arm.com>
Tested-by: Arm Jenkins <bsgcomp@arm.com>
Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'src/runtime/CL/functions/CLReductionOperation.cpp')
-rw-r--r-- | src/runtime/CL/functions/CLReductionOperation.cpp | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/src/runtime/CL/functions/CLReductionOperation.cpp b/src/runtime/CL/functions/CLReductionOperation.cpp index 77168998f8..b659ecfaf6 100644 --- a/src/runtime/CL/functions/CLReductionOperation.cpp +++ b/src/runtime/CL/functions/CLReductionOperation.cpp @@ -191,6 +191,11 @@ ICLTensor *CLReductionOperation::configure_intermediate_result_vector(ICLTensor void CLReductionOperation::configure(ICLTensor *input, ICLTensor *output, unsigned int axis, ReductionOperation op, bool keep_dims) { + configure(CLKernelLibrary::get().get_compile_context(), input, output, axis, op, keep_dims); +} + +void CLReductionOperation::configure(const CLCompileContext &compile_context, ICLTensor *input, ICLTensor *output, unsigned int axis, ReductionOperation op, bool keep_dims) +{ ARM_COMPUTE_ERROR_ON_NULLPTR(input, output); _op = op; _num_of_stages = calculate_number_of_stages_only_x_axis(input->info()->dimension(0), axis); @@ -218,7 +223,7 @@ void CLReductionOperation::configure(ICLTensor *input, ICLTensor *output, unsign _memory_group.manage(&_results_vector.back()); } - _reduction_kernels_vector[0].configure(input, output_internal, axis, op, 0); + _reduction_kernels_vector[0].configure(compile_context, input, output_internal, axis, op, 0); } else { @@ -318,15 +323,15 @@ void CLReductionOperation::configure(ICLTensor *input, ICLTensor *output, unsign ARM_COMPUTE_ERROR("Not supported"); } - _reduction_kernels_vector[0].configure(input, &_results_vector[0], axis, first_kernel_op); - _border_handlers_vector[0].configure(input, _reduction_kernels_vector[0].border_size(), BorderMode::CONSTANT, pixelValue); + _reduction_kernels_vector[0].configure(compile_context, input, &_results_vector[0], axis, first_kernel_op); + _border_handlers_vector[0].configure(compile_context, input, _reduction_kernels_vector[0].border_size(), BorderMode::CONSTANT, pixelValue); // Apply ReductionOperation on intermediate stages for(unsigned int i = 1; i < _num_of_stages - 1; ++i) { _memory_group.manage(&_results_vector[i]); - _reduction_kernels_vector[i].configure(&_results_vector[i - 1], &_results_vector[i], axis, intermediate_kernel_op); - _border_handlers_vector[i].configure(&_results_vector[i - 1], _reduction_kernels_vector[i].border_size(), BorderMode::CONSTANT, pixelValue); + _reduction_kernels_vector[i].configure(compile_context, &_results_vector[i - 1], &_results_vector[i], axis, intermediate_kernel_op); + _border_handlers_vector[i].configure(compile_context, &_results_vector[i - 1], _reduction_kernels_vector[i].border_size(), BorderMode::CONSTANT, pixelValue); _results_vector[i - 1].allocator()->allocate(); } @@ -339,14 +344,14 @@ void CLReductionOperation::configure(ICLTensor *input, ICLTensor *output, unsign _memory_group.manage(&_results_vector.back()); } - _reduction_kernels_vector[last_stage].configure(&_results_vector[last_stage - 1], output_internal, axis, last_kernel_op, input_width); - _border_handlers_vector[last_stage].configure(&_results_vector[last_stage - 1], _reduction_kernels_vector[last_stage].border_size(), BorderMode::CONSTANT, pixelValue); + _reduction_kernels_vector[last_stage].configure(compile_context, &_results_vector[last_stage - 1], output_internal, axis, last_kernel_op, input_width); + _border_handlers_vector[last_stage].configure(compile_context, &_results_vector[last_stage - 1], _reduction_kernels_vector[last_stage].border_size(), BorderMode::CONSTANT, pixelValue); _results_vector[last_stage - 1].allocator()->allocate(); } if(_is_reshape_required) { - _reshape_kernel.configure(&_results_vector.back(), output); + _reshape_kernel.configure(compile_context, &_results_vector.back(), output); _results_vector.back().allocator()->allocate(); } } |