summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunyan He <junyan.he@linux.intel.com>2015-12-01 16:10:31 +0800
committerYang Rong <rong.r.yang@intel.com>2015-12-14 15:11:28 +0800
commitfe3d0d8ed34b69de8a00ed5d41864a30cd497418 (patch)
tree76abd9d41c8d1d21682c286408901a9c6eda67fc
parentfbb2c48d11f6c898cca80781e879829c2ae8c56f (diff)
libocl: Refine the workgroup functions, add signed info.
Signed-off-by: Junyan He <junyan.he@linux.intel.com> Reviewed-by: Yang Rong <rong.r.yang@intel.com>
-rw-r--r--backend/src/libocl/src/ocl_work_group.cl114
1 files changed, 57 insertions, 57 deletions
diff --git a/backend/src/libocl/src/ocl_work_group.cl b/backend/src/libocl/src/ocl_work_group.cl
index 065b223d..5ad5a8f4 100644
--- a/backend/src/libocl/src/ocl_work_group.cl
+++ b/backend/src/libocl/src/ocl_work_group.cl
@@ -51,76 +51,76 @@ BROADCAST_IMPL(double)
#undef BROADCAST_IMPL
-#define RANGE_OP(RANGE, OP, GEN_TYPE) \
- OVERLOADABLE GEN_TYPE __gen_ocl_work_group_##RANGE##_##OP(GEN_TYPE x); \
+#define RANGE_OP(RANGE, OP, GEN_TYPE, SIGN) \
+ OVERLOADABLE GEN_TYPE __gen_ocl_work_group_##RANGE##_##OP(bool sign, GEN_TYPE x); \
OVERLOADABLE GEN_TYPE work_group_##RANGE##_##OP(GEN_TYPE x) { \
- return __gen_ocl_work_group_##RANGE##_##OP(x); \
+ return __gen_ocl_work_group_##RANGE##_##OP(SIGN, x); \
}
/* reduce add */
-RANGE_OP(reduce, add, int)
-RANGE_OP(reduce, add, uint)
-RANGE_OP(reduce, add, long)
-RANGE_OP(reduce, add, ulong)
-RANGE_OP(reduce, add, float)
-RANGE_OP(reduce, add, double)
+RANGE_OP(reduce, add, int, true)
+RANGE_OP(reduce, add, uint, false)
+RANGE_OP(reduce, add, long, true)
+RANGE_OP(reduce, add, ulong, false)
+RANGE_OP(reduce, add, float, true)
+RANGE_OP(reduce, add, double, true)
/* reduce min */
-RANGE_OP(reduce, min, int)
-RANGE_OP(reduce, min, uint)
-RANGE_OP(reduce, min, long)
-RANGE_OP(reduce, min, ulong)
-RANGE_OP(reduce, min, float)
-RANGE_OP(reduce, min, double)
+RANGE_OP(reduce, min, int, true)
+RANGE_OP(reduce, min, uint, false)
+RANGE_OP(reduce, min, long, true)
+RANGE_OP(reduce, min, ulong, false)
+RANGE_OP(reduce, min, float, true)
+RANGE_OP(reduce, min, double, true)
/* reduce max */
-RANGE_OP(reduce, max, int)
-RANGE_OP(reduce, max, uint)
-RANGE_OP(reduce, max, long)
-RANGE_OP(reduce, max, ulong)
-RANGE_OP(reduce, max, float)
-RANGE_OP(reduce, max, double)
+RANGE_OP(reduce, max, int, true)
+RANGE_OP(reduce, max, uint, false)
+RANGE_OP(reduce, max, long, true)
+RANGE_OP(reduce, max, ulong, false)
+RANGE_OP(reduce, max, float, true)
+RANGE_OP(reduce, max, double, true)
/* scan_inclusive add */
-RANGE_OP(scan_inclusive, add, int)
-RANGE_OP(scan_inclusive, add, uint)
-RANGE_OP(scan_inclusive, add, long)
-RANGE_OP(scan_inclusive, add, ulong)
-RANGE_OP(scan_inclusive, add, float)
-RANGE_OP(scan_inclusive, add, double)
+RANGE_OP(scan_inclusive, add, int, true)
+RANGE_OP(scan_inclusive, add, uint, false)
+RANGE_OP(scan_inclusive, add, long, true)
+RANGE_OP(scan_inclusive, add, ulong, false)
+RANGE_OP(scan_inclusive, add, float, true)
+RANGE_OP(scan_inclusive, add, double, true)
/* scan_inclusive min */
-RANGE_OP(scan_inclusive, min, int)
-RANGE_OP(scan_inclusive, min, uint)
-RANGE_OP(scan_inclusive, min, long)
-RANGE_OP(scan_inclusive, min, ulong)
-RANGE_OP(scan_inclusive, min, float)
-RANGE_OP(scan_inclusive, min, double)
+RANGE_OP(scan_inclusive, min, int, true)
+RANGE_OP(scan_inclusive, min, uint, false)
+RANGE_OP(scan_inclusive, min, long, true)
+RANGE_OP(scan_inclusive, min, ulong, false)
+RANGE_OP(scan_inclusive, min, float, true)
+RANGE_OP(scan_inclusive, min, double, true)
/* scan_inclusive max */
-RANGE_OP(scan_inclusive, max, int)
-RANGE_OP(scan_inclusive, max, uint)
-RANGE_OP(scan_inclusive, max, long)
-RANGE_OP(scan_inclusive, max, ulong)
-RANGE_OP(scan_inclusive, max, float)
-RANGE_OP(scan_inclusive, max, double)
+RANGE_OP(scan_inclusive, max, int, true)
+RANGE_OP(scan_inclusive, max, uint, false)
+RANGE_OP(scan_inclusive, max, long, true)
+RANGE_OP(scan_inclusive, max, ulong, false)
+RANGE_OP(scan_inclusive, max, float, true)
+RANGE_OP(scan_inclusive, max, double, true)
/* scan_exclusive add */
-RANGE_OP(scan_exclusive, add, int)
-RANGE_OP(scan_exclusive, add, uint)
-RANGE_OP(scan_exclusive, add, long)
-RANGE_OP(scan_exclusive, add, ulong)
-RANGE_OP(scan_exclusive, add, float)
-RANGE_OP(scan_exclusive, add, double)
+RANGE_OP(scan_exclusive, add, int, true)
+RANGE_OP(scan_exclusive, add, uint, false)
+RANGE_OP(scan_exclusive, add, long, true)
+RANGE_OP(scan_exclusive, add, ulong, false)
+RANGE_OP(scan_exclusive, add, float, true)
+RANGE_OP(scan_exclusive, add, double, true)
/* scan_exclusive min */
-RANGE_OP(scan_exclusive, min, int)
-RANGE_OP(scan_exclusive, min, uint)
-RANGE_OP(scan_exclusive, min, long)
-RANGE_OP(scan_exclusive, min, ulong)
-RANGE_OP(scan_exclusive, min, float)
-RANGE_OP(scan_exclusive, min, double)
+RANGE_OP(scan_exclusive, min, int, true)
+RANGE_OP(scan_exclusive, min, uint, false)
+RANGE_OP(scan_exclusive, min, long, true)
+RANGE_OP(scan_exclusive, min, ulong, false)
+RANGE_OP(scan_exclusive, min, float, true)
+RANGE_OP(scan_exclusive, min, double, true)
/* scan_exclusive max */
-RANGE_OP(scan_exclusive, max, int)
-RANGE_OP(scan_exclusive, max, uint)
-RANGE_OP(scan_exclusive, max, long)
-RANGE_OP(scan_exclusive, max, ulong)
-RANGE_OP(scan_exclusive, max, float)
-RANGE_OP(scan_exclusive, max, double)
+RANGE_OP(scan_exclusive, max, int, true)
+RANGE_OP(scan_exclusive, max, uint, false)
+RANGE_OP(scan_exclusive, max, long, true)
+RANGE_OP(scan_exclusive, max, ulong, false)
+RANGE_OP(scan_exclusive, max, float, true)
+RANGE_OP(scan_exclusive, max, double, true)
#undef RANGE_OP