aboutsummaryrefslogtreecommitdiff
path: root/src/core/CL/cl_kernels/convolution_layer.cl
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/CL/cl_kernels/convolution_layer.cl')
-rw-r--r--src/core/CL/cl_kernels/convolution_layer.cl6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/core/CL/cl_kernels/convolution_layer.cl b/src/core/CL/cl_kernels/convolution_layer.cl
index e3018461e3..c7e3e644f4 100644
--- a/src/core/CL/cl_kernels/convolution_layer.cl
+++ b/src/core/CL/cl_kernels/convolution_layer.cl
@@ -151,10 +151,14 @@ __kernel void im2col_generic(
{
#if PAD_LEFT == 0 && PAD_TOP == 0 && PAD_RIGHT == 0 && PAD_BOTTOM == 0
*output_ptr = *((__global DATA_TYPE *)(input_ptr + x * src_stride_x + y * src_stride_y));
-#else // PAD_LEFT == 0 && PAD_TOP == 0 && PAD_RIGHT == 0 && PAD_BOTTOM == 0
+#else // PAD_LEFT == 0 && PAD_TOP == 0 && PAD_RIGHT == 0 && PAD_BOTTOM == 0
if(x < 0 || x >= SRC_WIDTH || y < 0 || y >= SRC_HEIGHT)
{
+#if defined(OFFSET)
+ *output_ptr = OFFSET;
+#else /* OFFSET */
*output_ptr = 0;
+#endif /* OFFSET */
}
else
{