From 6b02cd380f1eadd38a3a0a32822d3e0e1e3a1efa Mon Sep 17 00:00:00 2001 From: =?utf8?q?Miko=C5=82aj=20=C5=BByczy=C5=84ski?= Date: Fri, 23 Oct 2020 09:16:21 +0200 Subject: [PATCH] [IE CLDNN] Fix padding in reduce fsv16 kernel (#2787) --- .../clDNN/kernel_selector/core/cl_kernels/reduce_gpu_b_fs_yx_fsv16.cl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/inference-engine/thirdparty/clDNN/kernel_selector/core/cl_kernels/reduce_gpu_b_fs_yx_fsv16.cl b/inference-engine/thirdparty/clDNN/kernel_selector/core/cl_kernels/reduce_gpu_b_fs_yx_fsv16.cl index 1d5f859..52a8388 100644 --- a/inference-engine/thirdparty/clDNN/kernel_selector/core/cl_kernels/reduce_gpu_b_fs_yx_fsv16.cl +++ b/inference-engine/thirdparty/clDNN/kernel_selector/core/cl_kernels/reduce_gpu_b_fs_yx_fsv16.cl @@ -203,6 +203,7 @@ KERNEL(reduce_fsv16)( const uint input_y_pitch = input_x_pitch * (INPUT0_PAD_BEFORE_SIZE_X + INPUT0_SIZE_X + INPUT0_PAD_AFTER_SIZE_X); const uint input_fs_pitch = input_y_pitch * (INPUT0_PAD_BEFORE_SIZE_Y + INPUT0_SIZE_Y + INPUT0_PAD_AFTER_SIZE_Y); const uint input_batch_pitch = input_fs_pitch * ((INPUT0_PAD_BEFORE_FEATURE_NUM + INPUT0_FEATURE_NUM + INPUT0_PAD_AFTER_FEATURE_NUM + FSV - 1) / FSV); + const uint padding_pitch = INPUT0_GET_INDEX(0, 0, 0, 0); const uint output_x_pitch = FSV; const uint output_y_pitch = FSV * (OUTPUT_PAD_BEFORE_SIZE_X + OUTPUT_SIZE_X + OUTPUT_PAD_AFTER_SIZE_X); @@ -243,7 +244,7 @@ KERNEL(reduce_fsv16)( const uint x_leftover_end = x_max_val; #endif -uint offset = batch_out * input_batch_pitch + ((feature_out + FSV - 1) / FSV) * input_fs_pitch + y_out * input_y_pitch + x_out * input_x_pitch; +uint offset = batch_out * input_batch_pitch + ((feature_out + FSV - 1) / FSV) * input_fs_pitch + y_out * input_y_pitch + x_out * input_x_pitch + padding_pitch; #if REDUCE_X ACCUMULATOR_TYPE acc = INIT_VAL; -- 2.7.4