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

Yaxun Liu via cfe-commits cfe-commits at lists.llvm.org
Tue May 10 07:39:02 PDT 2016


yaxunl marked an inline comment as done.
yaxunl added a comment.

Updated summary.


================
Comment at: test/SemaOpenCL/to_addr_builtin.cl:25
@@ +24,3 @@
+  glob = to_global(con);
+#if __OPENCL_C_VERSION__ < CL_VERSION_2_0
+  // expected-error at -2{{'to_global' needs OpenCL version 2.0 or above}}
----------------
pxli168 wrote:
> But in Spec OpenCL V2.0 s6.13.9 the description for to_global is:
> 
> > Returns a pointer that points to a region in the global address space if to_global can cast ptr to the global address space. Otherwise it returns NULL.
> 
I think this is only for valid call expression. For constant pointer, it is an invalid call expression due to s6.5.5, so an error of invalid argument should be emitted.

If we allow passing constant pointer to this function, we violates s6.5.5.


http://reviews.llvm.org/D19932





More information about the cfe-commits mailing list