aboutsummaryrefslogtreecommitdiff
path: root/src/core/CL/kernels/CLMeanStdDevKernel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/CL/kernels/CLMeanStdDevKernel.cpp')
-rw-r--r--src/core/CL/kernels/CLMeanStdDevKernel.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/core/CL/kernels/CLMeanStdDevKernel.cpp b/src/core/CL/kernels/CLMeanStdDevKernel.cpp
index b0b748f466..1b70d7513f 100644
--- a/src/core/CL/kernels/CLMeanStdDevKernel.cpp
+++ b/src/core/CL/kernels/CLMeanStdDevKernel.cpp
@@ -40,10 +40,15 @@
using namespace arm_compute;
CLMeanStdDevKernel::CLMeanStdDevKernel()
- : _input(nullptr), _mean(nullptr), _stddev(nullptr), _global_sum(nullptr), _global_sum_squared(nullptr)
+ : _input(nullptr), _mean(nullptr), _stddev(nullptr), _global_sum(nullptr), _global_sum_squared(nullptr), _border_size(0)
{
}
+BorderSize CLMeanStdDevKernel::border_size() const
+{
+ return _border_size;
+}
+
void CLMeanStdDevKernel::configure(const ICLImage *input, float *mean, cl::Buffer *global_sum, float *stddev, cl::Buffer *global_sum_squared)
{
ARM_COMPUTE_ERROR_ON_TENSOR_NOT_2D(input);
@@ -83,6 +88,9 @@ void CLMeanStdDevKernel::configure(const ICLImage *input, float *mean, cl::Buffe
constexpr unsigned int num_elems_processed_per_iteration_x = 8;
const unsigned int num_elems_processed_per_iteration_y = input->info()->dimension(1);
+ _border_size = BorderSize(std::max(static_cast<int>(num_elems_processed_per_iteration_x) - static_cast<int>(input->info()->dimension(0)),
+ static_cast<int>(input->info()->dimension(0) % num_elems_processed_per_iteration_x)));
+
Window win = calculate_max_window(*input->info(), Steps(num_elems_processed_per_iteration_x, num_elems_processed_per_iteration_y));
AccessWindowRectangle input_access(input->info(), 0, 0, num_elems_processed_per_iteration_x, num_elems_processed_per_iteration_y);
update_window_and_padding(win, input_access);