summaryrefslogtreecommitdiff
path: root/kernels
diff options
context:
space:
mode:
authorJunyan He <junyan.he@linux.intel.com>2015-01-06 18:02:59 +0800
committerZhigang Gong <zhigang.gong@intel.com>2015-01-20 16:31:14 +0800
commitf3339eb4b97706472adbe6b560dc3f4677860e4d (patch)
tree800f8a42588431bee31c7084126a492067caed4b /kernels
parent74dfa7c009ea41c195f49937abe0de4eedf852f8 (diff)
Add test case for long mul_sat and mul_hi
Signed-off-by: Junyan He <junyan.he@linux.intel.com> Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
Diffstat (limited to 'kernels')
-rw-r--r--kernels/compiler_long_hi_sat.cl19
1 files changed, 19 insertions, 0 deletions
diff --git a/kernels/compiler_long_hi_sat.cl b/kernels/compiler_long_hi_sat.cl
new file mode 100644
index 00000000..66e4ab91
--- /dev/null
+++ b/kernels/compiler_long_hi_sat.cl
@@ -0,0 +1,19 @@
+kernel void compiler_long_mul_hi(global long *src, global long *dst, long num0, long num1) {
+ int i = get_local_id(0);
+ long c;
+
+ if (i % 2 == 0) {
+ c = mul_hi(src[i], num0);
+ } else {
+ c = mul_hi(src[i], num1);
+ }
+ dst[i] = c;
+}
+
+kernel void compiler_long_mul_sat(global long *src, global long *dst, long num0, long num1) {
+ int i = get_local_id(0);
+ long c;
+
+ c = mad_sat(src[i], num0, num1);
+ dst[i] = c;
+}