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

Tom Stellard via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 14 13:04:26 PDT 2016


tstellarAMD added inline comments.

================
Comment at: lib/Headers/opencl.h:11-13
@@ +10,5 @@
+
+#if !defined(__SPIR32__) && !defined(__SPIR64__)
+#error "This header file should be used with SPIR target only."
+#endif
+
----------------
This should be removed so they can be used with any target.

================
Comment at: lib/Headers/opencl.h:53-57
@@ +52,7 @@
+ */
+#if defined(__SPIR32__)
+typedef uint size_t;
+#elif defined(__SPIR64__)
+typedef ulong size_t;
+#endif
+
----------------
This needs to be removed too.

================
Comment at: lib/Headers/opencl.h:65-69
@@ +64,7 @@
+ */
+#if defined(__SPIR32__)
+typedef int ptrdiff_t;
+#elif defined(__SPIR64__ )
+typedef long ptrdiff_t;
+#endif
+
----------------
And this.

================
Comment at: lib/Headers/opencl.h:70-84
@@ +69,17 @@
+#endif
+
+/**
+* A signed integer type with the property that any valid pointer to
+* void can be converted to this type, then converted back to pointer
+* to void, and the result will compare equal to the original pointer.
+*/
+typedef ptrdiff_t intptr_t;
+
+/**
+* An unsigned integer type with the property that any valid pointer to
+* void can be converted to this type, then converted back to pointer
+* to void, and the result will compare equal to the original pointer.
+*/
+typedef size_t uintptr_t;
+
+// built-in vector data types:
----------------
Do we actually need these typdefs?  I thought clang automatically set these for OpenCL.


http://reviews.llvm.org/D18369





More information about the cfe-commits mailing list