[PATCH] D18369: [OpenCL] Upstreaming khronos OpenCL header file.

Yaxun Liu via cfe-commits cfe-commits at lists.llvm.org
Mon May 2 13:10:17 PDT 2016


yaxunl added inline comments.

================
Comment at: lib/Headers/opencl-c.h:4872
@@ +4871,3 @@
+
+#ifdef cl_khr_fp64
+char __const_func __attribute__((overloadable)) convert_char(double);
----------------
Anastasia wrote:
> Interesting, macro has the same name as an extension?
The spec requires a macro to be defined with the same name as the supported extension, so it is natural to use it here.

================
Comment at: lib/Headers/opencl-c.h:14056
@@ +14055,3 @@
+#ifdef _CL20_AND_ABOVE
+#define ATOMIC_VAR_INIT(x) (x)
+
----------------
Anastasia wrote:
> I am not sure this implementation of macro is generic enough!
This macro is for initializing global variables with atomic type. In SPIR it is represented as usual initializer the same way as a non-atomic type. OpenCL runtime initializes it the same way as a non-atomic type before kernel execution. I don't think there is need to define this macro another way.


http://reviews.llvm.org/D18369





More information about the cfe-commits mailing list