[PATCH] D19932: [OpenCL] Add to_{global|local|private} builtin functions.

Xiuli PAN via cfe-commits cfe-commits at lists.llvm.org
Sun May 8 21:16:17 PDT 2016


pxli168 added a comment.

The pointer type seems to be not that important, we can just cast it to any type we want.


================
Comment at: test/SemaOpenCL/to_addr_builtin.cl:24
@@ +23,3 @@
+
+  glob = to_global(con);
+#if __OPENCL_C_VERSION__ < CL_VERSION_2_0
----------------
should this return a NULL or a build error?

================
Comment at: test/SemaOpenCL/to_addr_builtin.cl:35
@@ +34,3 @@
+#else
+  // expected-error at -4{{assigning '__global int *' to '__local int *' changes address space of pointer}}
+#endif
----------------
I think this will be handled by pointer bitcast if we used some void* as well, the address space is the important thing of these built-ins.


http://reviews.llvm.org/D19932





More information about the cfe-commits mailing list