diff options
author | Luo Xionghu <xionghu.luo@intel.com> | 2014-11-04 06:42:36 +0800 |
---|---|---|
committer | Zhigang Gong <zhigang.gong@intel.com> | 2014-11-04 19:05:01 +0800 |
commit | 04a8b4e8a4e484f6c9346d5af969aed8606be774 (patch) | |
tree | 98ba6822ed2b33f4be3b7eb2255b3c1a6de75772 /kernels | |
parent | 79a0abf7e78d79ec339ea04265b2821f7303dfcb (diff) |
add utest function bswap.
this llvm instrincs bswap function is generated by calling
__builtin_bswap.
Signed-off-by: Luo Xionghu <xionghu.luo@intel.com>
Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
Diffstat (limited to 'kernels')
-rw-r--r-- | kernels/compiler_bswap.cl | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/kernels/compiler_bswap.cl b/kernels/compiler_bswap.cl new file mode 100644 index 00000000..d6ed91a9 --- /dev/null +++ b/kernels/compiler_bswap.cl @@ -0,0 +1,7 @@ +kernel void compiler_bswap_short(global short* src, global short* dst){ + dst[get_global_id(0)]= __builtin_bswap16(src[get_global_id(0)]); +} + +kernel void compiler_bswap_int(global int* src, global int* dst){ + dst[get_global_id(0)]= __builtin_bswap32(src[get_global_id(0)]); +} |