aboutsummaryrefslogtreecommitdiff
path: root/src/core/CL/kernels/CLReductionOperationKernel.cpp
diff options
context:
space:
mode:
authorAnthony Barbier <anthony.barbier@arm.com>2018-08-08 13:20:04 +0100
committerAnthony Barbier <anthony.barbier@arm.com>2018-11-02 16:54:54 +0000
commitb6eb35371d222c6b7f61210d97ebd7dd9e197458 (patch)
treeaf89729ad68d665916c37abb5fd49e512fa40614 /src/core/CL/kernels/CLReductionOperationKernel.cpp
parent1d1f32ce7ef6acea4afd4cf6a929436640b72ccd (diff)
downloadComputeLibrary-b6eb35371d222c6b7f61210d97ebd7dd9e197458.tar.gz
COMPMID-1478: Stop relying on static default OpenCL objects in cl2.hpp
This causes problems when ACL is used as a shared library on Android. Fixes some problems related to creation / destruction order between the Graph's CL backend and core / runtime Change-Id: I716d63fd42f4586df1ffbb6fa97e4db06d3a781b Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/143228 Tested-by: Jenkins <bsgcomp@arm.com> Reviewed-by: Michele DiGiorgio <michele.digiorgio@arm.com> Reviewed-by: Gian Marco Iodice <gianmarco.iodice@arm.com>
Diffstat (limited to 'src/core/CL/kernels/CLReductionOperationKernel.cpp')
-rw-r--r--src/core/CL/kernels/CLReductionOperationKernel.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/core/CL/kernels/CLReductionOperationKernel.cpp b/src/core/CL/kernels/CLReductionOperationKernel.cpp
index 09861630ac..bf36ae2c0f 100644
--- a/src/core/CL/kernels/CLReductionOperationKernel.cpp
+++ b/src/core/CL/kernels/CLReductionOperationKernel.cpp
@@ -114,8 +114,8 @@ void CLReductionOperationKernel::configure(const ICLTensor *input, ICLTensor *ou
// Set the number of WG based on the input size. If input width is < 128
// we can use fewer threads than 8.
- _lws_hint = cl::NDRange(std::min(8U, num_of_threads));
- _border_size = BorderSize(0, border_width, 0, 0);
+ cl::NDRange lws_hint = cl::NDRange(std::min(8U, num_of_threads));
+ _border_size = BorderSize(0, border_width, 0, 0);
// Set build options
std::set<std::string> build_opts;
@@ -142,7 +142,7 @@ void CLReductionOperationKernel::configure(const ICLTensor *input, ICLTensor *ou
ARM_COMPUTE_ERROR_THROW_ON(std::get<0>(win_config));
- ICLKernel::configure(std::get<1>(win_config));
+ ICLKernel::configure_internal(std::get<1>(win_config), lws_hint);
}
Status CLReductionOperationKernel::validate(const ITensorInfo *input, const ITensorInfo *output, unsigned int axis, ReductionOperation op)
@@ -171,7 +171,7 @@ void CLReductionOperationKernel::run(const Window &window, cl::CommandQueue &que
in_slice.set(Window::DimX, Window::Dimension(in_slice.x().start(), in_slice.x().end() + border_width, in_slice.x().step()));
// Set local sums buffer
- unsigned int local_sum_size = _lws_hint[0] * _input->info()->element_size();
+ unsigned int local_sum_size = lws_hint()[0] * _input->info()->element_size();
_kernel.setArg(num_arguments_per_2D_tensor() * 2, local_sum_size, nullptr);
do
@@ -179,7 +179,7 @@ void CLReductionOperationKernel::run(const Window &window, cl::CommandQueue &que
unsigned int idx = 0;
add_2D_tensor_argument(idx, _input, in_slice);
add_2D_tensor_argument(idx, _output, out_slice);
- enqueue(queue, *this, in_slice, _lws_hint);
+ enqueue(queue, *this, in_slice, lws_hint());
}
while(window.slide_window_slice_2D(in_slice) && window.slide_window_slice_2D(out_slice));
}