From 3888f4b62342f6a216acbb0164ed26283cc0f6dc Mon Sep 17 00:00:00 2001 From: Tomas Farago Date: Thu, 8 Aug 2019 11:26:55 +0200 Subject: Fix rm-outliers boundary condition --- src/kernels/rm-outliers.cl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/kernels/rm-outliers.cl b/src/kernels/rm-outliers.cl index 586ed05..4f71ceb 100644 --- a/src/kernels/rm-outliers.cl +++ b/src/kernels/rm-outliers.cl @@ -37,7 +37,7 @@ filter (global float *input, int height = get_global_size(1); /* Check for boundary elements */ - if (abs(idx - width) < HALF_SIZE && abs(idy - height) < HALF_SIZE) + if (idy < HALF_SIZE || idy + HALF_SIZE >= height || idx < HALF_SIZE || idx + HALF_SIZE >= width) output[idy * width + idx] = input[idy * width + idx]; else { float elements[BOX_SIZE * BOX_SIZE]; -- cgit v1.2.1