aboutsummaryrefslogtreecommitdiff
path: root/src/core/CL/kernels/CLElementWiseUnaryLayerKernel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/CL/kernels/CLElementWiseUnaryLayerKernel.cpp')
-rw-r--r--src/core/CL/kernels/CLElementWiseUnaryLayerKernel.cpp22
1 files changed, 14 insertions, 8 deletions
diff --git a/src/core/CL/kernels/CLElementWiseUnaryLayerKernel.cpp b/src/core/CL/kernels/CLElementWiseUnaryLayerKernel.cpp
index c7f9df0baa..bff0db07a0 100644
--- a/src/core/CL/kernels/CLElementWiseUnaryLayerKernel.cpp
+++ b/src/core/CL/kernels/CLElementWiseUnaryLayerKernel.cpp
@@ -60,6 +60,9 @@ void CLElementWiseUnaryLayerKernel::configure(const ITensorInfo *input, ITensorI
void CLElementWiseUnaryLayerKernel::configure(const CLCompileContext &compile_context, const ITensorInfo *input, ITensorInfo *output, const ElementWiseUnary &op)
{
ARM_COMPUTE_ERROR_ON_NULLPTR(input, output);
+
+ auto padding_info = get_padding_info({ input, output });
+
ARM_COMPUTE_ERROR_THROW_ON(validate_arguments(*input, *output));
const std::string kernel_name = "elementwise_unary";
@@ -67,14 +70,6 @@ void CLElementWiseUnaryLayerKernel::configure(const CLCompileContext &compile_co
const int output_width_x = output->tensor_shape().x();
const bool multi_access_x = (output_width_x / vec_size_x > 0);
- Window win = calculate_max_window(*output);
- if(multi_access_x)
- {
- win.set(Window::DimX,
- Window::Dimension(win.x().start(), ceil_to_multiple(win.x().end(), vec_size_x), vec_size_x));
- }
- ICLKernel::configure_internal(win);
-
// Set kernel build options
CLBuildOptions build_opts;
build_opts.add_option("-DDATA_TYPE=" + get_cl_type_from_data_type(input->data_type()));
@@ -109,6 +104,17 @@ void CLElementWiseUnaryLayerKernel::configure(const CLCompileContext &compile_co
// Create kernel
_kernel = create_kernel(compile_context, kernel_name, build_opts.options());
+
+ // Configure kernel window
+ Window win = calculate_max_window(*output);
+ if(multi_access_x)
+ {
+ win.set(Window::DimX,
+ Window::Dimension(win.x().start(), ceil_to_multiple(win.x().end(), vec_size_x), vec_size_x));
+ }
+ ICLKernel::configure_internal(win);
+
+ ARM_COMPUTE_ERROR_ON(has_padding_changed(padding_info));
}
Status CLElementWiseUnaryLayerKernel::validate(const ITensorInfo *input, const ITensorInfo *output, const ElementWiseUnary &op)