summaryrefslogtreecommitdiff
path: root/kernels
diff options
context:
space:
mode:
authorGuo Yejun <yejun.guo@intel.com>2014-02-27 06:54:26 +0800
committerZhigang Gong <zhigang.gong@intel.com>2014-02-28 13:33:28 +0800
commitb918ba339bffcebcac52247665205238525de175 (patch)
tree6c615bcfd2f4538240d26fbda4956a5ccfcee0f2 /kernels
parent04316f7ec5e4d2ab220c14020dc5808dfe663e80 (diff)
GBE: support getelementptr with ConstantExpr operand
Add support during LLVM IR -> Gen IR period when the first operand of getelementptr is ConstantExpr. utest is also added. Signed-off-by: Guo Yejun <yejun.guo@intel.com> Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
Diffstat (limited to 'kernels')
-rw-r--r--kernels/compiler_getelementptr_bitcast.cl18
1 files changed, 18 insertions, 0 deletions
diff --git a/kernels/compiler_getelementptr_bitcast.cl b/kernels/compiler_getelementptr_bitcast.cl
new file mode 100644
index 00000000..0320abf4
--- /dev/null
+++ b/kernels/compiler_getelementptr_bitcast.cl
@@ -0,0 +1,18 @@
+__kernel void compiler_getelementptr_bitcast(global float *src, global float *dst)
+{
+ int i = get_global_id(0);
+
+ __local float ldata[256];
+ ldata[get_local_id(0)] = src[i];
+
+ //if use get_local_id(0) to index ldata, the issue is not reproduced
+ //so, just set the work group as 1 in the application
+ __local uchar * pldata = (__local uchar *)&ldata[0];
+ uchar data;
+ for(int k = 0; k < 3; k++){
+ data = *pldata;
+ pldata++;
+ }
+
+ dst[i] = data;
+}