aboutsummaryrefslogtreecommitdiff
path: root/src/core/CL/cl_kernels/non_linear_filter3x3.cl
diff options
context:
space:
mode:
authorAnthony Barbier <anthony.barbier@arm.com>2017-07-03 17:39:37 +0100
committerAnthony Barbier <anthony.barbier@arm.com>2018-09-17 14:15:39 +0100
commitac69aa137e360340fe9f148f019d93af6c3d8336 (patch)
tree88c2fb6ea8693c69b19d3b7b38fe26cd916303c8 /src/core/CL/cl_kernels/non_linear_filter3x3.cl
parent05da6dd102c988081c7d5eccb227f559f740ceef (diff)
downloadComputeLibrary-ac69aa137e360340fe9f148f019d93af6c3d8336.tar.gz
COMPMID-418 Add check and fix comments after preprocessor conditions
Change-Id: I1353fd652ee180e3931e58b4ce13d651a48c7e2c Reviewed-on: http://mpd-gerrit.cambridge.arm.com/79567 Tested-by: Kaizen <jeremy.johnson+kaizengerrit@arm.com> Reviewed-by: Moritz Pflanzer <moritz.pflanzer@arm.com>
Diffstat (limited to 'src/core/CL/cl_kernels/non_linear_filter3x3.cl')
-rw-r--r--src/core/CL/cl_kernels/non_linear_filter3x3.cl42
1 files changed, 21 insertions, 21 deletions
diff --git a/src/core/CL/cl_kernels/non_linear_filter3x3.cl b/src/core/CL/cl_kernels/non_linear_filter3x3.cl
index f860c96bb8..19118ea23b 100644
--- a/src/core/CL/cl_kernels/non_linear_filter3x3.cl
+++ b/src/core/CL/cl_kernels/non_linear_filter3x3.cl
@@ -54,13 +54,13 @@ __kernel void non_linear_filter_box3x3(
uchar16 bottom = vload16(0, offset(&src, -1, 1));
// Apply respective filter
-#if defined MIN
- uchar16 tmp = min(top, min(middle, bottom));
- uchar8 out = row_reduce_min_3(tmp);
-#elif defined MAX
+#ifdef MIN
+ uchar16 tmp = min(top, min(middle, bottom));
+ uchar8 out = row_reduce_min_3(tmp);
+#elif defined(MAX)
uchar16 tmp = max(top, max(middle, bottom));
uchar8 out = row_reduce_max_3(tmp);
-#elif defined MEDIAN
+#elif defined(MEDIAN)
uchar8 p0 = top.s01234567;
uchar8 p1 = top.s12345678;
uchar8 p2 = top.s23456789;
@@ -71,9 +71,9 @@ __kernel void non_linear_filter_box3x3(
uchar8 p7 = bottom.s12345678;
uchar8 p8 = bottom.s23456789;
uchar8 out = sort9(p0, p1, p2, p3, p4, p5, p6, p7, p8);
-#else
+#else /* MIN or MAX or MEDIAN */
#error "Unsupported filter function"
-#endif
+#endif /* MIN or MAX or MEDIAN */
// Store result
vstore8(out, 0, dst.ptr);
@@ -109,22 +109,22 @@ __kernel void non_linear_filter_cross3x3(
uchar8 bottom = vload8(0, offset(&src, 0, 1));
// Apply respective filter
-#if defined MIN
- uchar8 tmp_middle = row_reduce_min_3(middle);
- uchar8 out = min(tmp_middle, min(top, bottom));
-#elif defined MAX
+#ifdef MIN
+ uchar8 tmp_middle = row_reduce_min_3(middle);
+ uchar8 out = min(tmp_middle, min(top, bottom));
+#elif defined(MAX)
uchar8 tmp_middle = row_reduce_max_3(middle);
uchar8 out = max(tmp_middle, max(top, bottom));
-#elif defined MEDIAN
+#elif defined(MEDIAN)
uchar8 p0 = top.s01234567;
uchar8 p1 = middle.s01234567;
uchar8 p2 = middle.s12345678;
uchar8 p3 = middle.s23456789;
uchar8 p4 = bottom.s01234567;
uchar8 out = sort5(p0, p1, p2, p3, p4);
-#else
+#else /* MIN or MAX or MEDIAN */
#error "Unsupported filter function"
-#endif
+#endif /* MIN or MAX or MEDIAN */
// Store result
vstore8(out, 0, dst.ptr);
@@ -160,13 +160,13 @@ __kernel void non_linear_filter_disk3x3(
uchar16 bottom = vload16(0, offset(&src, -1, 1));
// Apply respective filter
-#if defined MIN
- uchar16 tmp = min(top, min(middle, bottom));
- uchar8 out = row_reduce_min_3(tmp);
-#elif defined MAX
+#ifdef MIN
+ uchar16 tmp = min(top, min(middle, bottom));
+ uchar8 out = row_reduce_min_3(tmp);
+#elif defined(MAX)
uchar16 tmp = max(top, max(middle, bottom));
uchar8 out = row_reduce_max_3(tmp);
-#elif defined MEDIAN
+#elif defined(MEDIAN)
uchar8 p0 = top.s01234567;
uchar8 p1 = top.s12345678;
uchar8 p2 = top.s23456789;
@@ -177,9 +177,9 @@ __kernel void non_linear_filter_disk3x3(
uchar8 p7 = bottom.s12345678;
uchar8 p8 = bottom.s23456789;
uchar8 out = sort9(p0, p1, p2, p3, p4, p5, p6, p7, p8);
-#else
+#else /* MIN or MAX or MEDIAN */
#error "Unsupported filter function"
-#endif
+#endif /* MIN or MAX or MEDIAN */
// Store result
vstore8(out, 0, dst.ptr);