[PATCH] D18369: [OpenCL] Upstreaming khronos OpenCL 1.2/2.0 header files.

Anastasia Stulova via cfe-commits cfe-commits at lists.llvm.org
Fri Apr 1 09:49:59 PDT 2016


Anastasia added a comment.

In http://reviews.llvm.org/D18369#389469, @yaxunl wrote:

> One of the difference between opencl-12.cl and opencl-20.cl is opencl-12.cl defines
>
>   #define const_func __attribute__((const))
>   #define readonly __attribute__((pure))
>   
>
> and uses them for many functions, e.g.
>
>   float const_func __attribute__((overloadable)) acos(float);
>   
>
> I think this is a nice feature for performance. However surprisingly opencl-20.cl does not do that.
>
> I suggest to keep these attributes in the merged file. What do you think? Thanks.


I think it's OK to have them them in. But if we keep this, could we use "__" prefix to avoid possible clashes with the custom code identifiers (the same should apply to any other identifiers which we declare in this header that is not specified in Spec).

> Do you agree that we should have one single opencl.h instead of headers for different OpenCL versions?


The only concern about having one header would be its parsing speed due to large size. But I believe that the proportion of CL1.2 and CL2.0 declarations isn't really large. So perhaps we won't gain much from separating into multiple.

> >   What about OpenCL 1.1 header? Ideally it would be nice to have them in too!

> 




> We can add it later after we done with 1.2 and 2.0 headers.


Since CL1.2 and CL2.0 are derived from CL1.1, it would make sense to fix the declarations (header) for CL1.1 too.


http://reviews.llvm.org/D18369





More information about the cfe-commits mailing list