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

Yaxun Liu via cfe-commits cfe-commits at lists.llvm.org
Tue May 24 16:26:14 PDT 2016


yaxunl added inline comments.

================
Comment at: lib/Headers/opencl-c.h:143
@@ +142,3 @@
+#if __OPENCL_C_VERSION__ >= CL_VERSION_2_0
+#define NULL                              ((void*)0)
+#endif
----------------
Anastasia wrote:
> indentation seems wrong!
fixed.

================
Comment at: lib/Headers/opencl-c.h:175
@@ +174,3 @@
+ */
+#define NAN as_float(INT_MAX)
+
----------------
Anastasia wrote:
> Is this a part of spec? I don't see it in s6.13.2.1.
see v1.1 s6.11.2.

================
Comment at: lib/Headers/opencl-c.h:7953
@@ +7952,3 @@
+/**
+ * Compute the base e exponential of x.
+ */
----------------
Anastasia wrote:
> Ping!
I think "base e exponential" is the correct name. It could be renamed as "base e exponential function" to be more clear.

"exponent" is the 'superscript' part of an exponential. e.g. in e^n, n is the exponent.

================
Comment at: lib/Headers/opencl-c.h:8307
@@ +8306,3 @@
+#else
+float _ovld fract(float x, __global float *iptr);
+float2 _ovld fract(float2 x, __global float2 *iptr);
----------------
Anastasia wrote:
> Any problem with doing this unconditionally?
This requires vendors to implement functions not required by OpenCL 2.0 spec. For example, in our 2.0 builtin library we don't have such functions.

================
Comment at: lib/Headers/opencl-c.h:8458
@@ +8457,3 @@
+/**
+ * Compute the value of the square root of x^2+ y^2
+ * without undue overflow or underflow.
----------------
Anastasia wrote:
> Ping!
Fixed.

================
Comment at: lib/Headers/opencl-c.h:12773
@@ +12772,3 @@
+#ifdef cl_khr_fp16
+half _ovld vload(size_t offset, const half *p);
+half2 _ovld vload2(size_t offset, const half *p);
----------------
Anastasia wrote:
> Ping!
no. they are different. see OpenCL extensions v1.1 s9.6.6, v1.2 s9.5.6, v2.0 s9.4.6


http://reviews.llvm.org/D18369





More information about the cfe-commits mailing list