summaryrefslogtreecommitdiff
path: root/kernels
diff options
context:
space:
mode:
authorJunyan He <junyan.he@linux.intel.com>2015-01-19 15:35:04 +0800
committerZhigang Gong <zhigang.gong@intel.com>2015-01-20 16:31:28 +0800
commit8d96ef5c5fe6b9500abe00a049fbe2b62963b83b (patch)
treef9b76f0077d5bf810348d652f1e58c481e61c802 /kernels
parent8633536034c775976289fd8e59e4924b81211934 (diff)
Add test case for long bitcast.
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_bitcast.cl47
1 files changed, 47 insertions, 0 deletions
diff --git a/kernels/compiler_long_bitcast.cl b/kernels/compiler_long_bitcast.cl
new file mode 100644
index 00000000..4b008ef1
--- /dev/null
+++ b/kernels/compiler_long_bitcast.cl
@@ -0,0 +1,47 @@
+__kernel void compiler_bitcast_char8_to_long(__global char8 *src, __global ulong *dst)
+{
+ int tid = get_global_id(0);
+ char8 v = src[tid];
+ ulong dl = as_ulong(v);
+ dst[tid] = dl;
+}
+
+__kernel void compiler_bitcast_long_to_char8(__global ulong *src, __global uchar8 *dst)
+{
+ int tid = get_global_id(0);
+ ulong v = src[tid];
+ uchar8 dl = as_uchar8(v);
+ dst[tid] = dl;
+}
+
+__kernel void compiler_bitcast_int2_to_long(__global int2 *src, __global ulong *dst)
+{
+ int tid = get_global_id(0);
+ int2 v = src[tid];
+ ulong dl = as_ulong(v);
+ dst[tid] = dl;
+}
+
+__kernel void compiler_bitcast_long_to_int2(__global ulong *src, __global uint2 *dst)
+{
+ int tid = get_global_id(0);
+ ulong v = src[tid];
+ uint2 dl = as_uint2(v);
+ dst[tid] = dl;
+}
+
+__kernel void compiler_bitcast_short4_to_long(__global short4 *src, __global ulong *dst)
+{
+ int tid = get_global_id(0);
+ short4 v = src[tid];
+ ulong dl = as_ulong(v);
+ dst[tid] = dl;
+}
+
+__kernel void compiler_bitcast_long_to_short4(__global ulong *src, __global ushort4 *dst)
+{
+ int tid = get_global_id(0);
+ ulong v = src[tid];
+ ushort4 dl = as_ushort4(v);
+ dst[tid] = dl;
+}