[Beignet] [PATCH 11/12] fix kernel build warnings.

xionghu.luo at intel.com xionghu.luo at intel.com
Thu May 5 16:11:54 UTC 2016


From: Luo Xionghu <xionghu.luo at intel.com>

^ has lower precedence than <, add parentheses.

Signed-off-by: Luo Xionghu <xionghu.luo at intel.com>
---
 kernels/compiler_bsort.cl | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/kernels/compiler_bsort.cl b/kernels/compiler_bsort.cl
index db40da8..fbec427 100644
--- a/kernels/compiler_bsort.cl
+++ b/kernels/compiler_bsort.cl
@@ -3,17 +3,17 @@
 
 /* Sort elements in a vector */
 #define SORT_VECTOR(input, dir)                                   \
-   comp = input < shuffle(input, mask1) ^ dir;                    \
+   comp = (input < shuffle(input, mask1)) ^ dir;                  \
    input = shuffle(input, as_uint4(comp + add1));                 \
-   comp = input < shuffle(input, mask2) ^ dir;                    \
+   comp = (input < shuffle(input, mask2)) ^ dir;                  \
    input = shuffle(input, as_uint4(comp * 2 + add2));             \
-   comp = input < shuffle(input, mask3) ^ dir;                    \
+   comp = (input < shuffle(input, mask3)) ^ dir;                  \
    input = shuffle(input, as_uint4(comp + add3));                 \
 
 /* Sort elements between two vectors */
 #define SWAP_VECTORS(input1, input2, dir)                         \
    temp = input1;                                                 \
-   comp = (input1 < input2 ^ dir) * 4 + add4;                     \
+   comp = ((input1 < input2) ^ dir) * 4 + add4;                   \
    input1 = shuffle2(input1, input2, as_uint4(comp));             \
    input2 = shuffle2(input2, temp, as_uint4(comp));               \
 
-- 
2.1.4



More information about the Beignet mailing list