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

2016-05-16 Thread James Price via cfe-commits
jprice added inline comments.


Comment at: lib/Headers/opencl-c.h:17051
@@ +17050,3 @@
+#define CLK_SUCCESS 0
+#define CLK_ENQUEUE_FAILURE -101
+#define CLK_INVALID_QUEUE   -102

yaxunl wrote:
> Anastasia wrote:
> > Are those arbitrary taken values I am guessing?
> How about this?
> 
>   // The value are defined according to their order in the spec.
>   #define CLK_SUCCESS 0
>   #define CLK_ENQUEUE_FAILURE -1
>   #define CLK_INVALID_QUEUE   -2
>   #define CLK_INVALID_NDRANGE -3
>   #define CLK_INVALID_EVENT_WAIT_LIST -4
>   #define CLK_DEVICE_QUEUE_FULL   -5
>   #define CLK_INVALID_ARG_SIZE-6
>   #define CLK_EVENT_ALLOCATION_FAILURE-8
>   #define CLK_OUT_OF_RESOURCES-9
> 
These values were taken from the table in section 2.10.6.1 in the SPIR 2.0 
provisional spec. Some of the choices seem arbitrary, while others were chosen 
to match the value of the equivalent runtime API error.

I imagine changing these values now might cause incompatibilities with existing 
SPIR consumers?


http://reviews.llvm.org/D18369



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


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

2016-03-31 Thread James Price via cfe-commits
jprice added a subscriber: jprice.
jprice added a comment.

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

> In http://reviews.llvm.org/D18369#385799, @Anastasia wrote:
>
> > Is there any chance we could factor out the common bits into separate files 
> > to avoid large code repetition? I would imagine it should be quite doable 
> > as libs of each standard contain incremental changes.
>
>
> I saw some inconsistencies in the common part of the 1.2 and 2.0 headers. I 
> will try to consolidate them first then try to split.


Rather than having a separate header for each version with another header for 
the common parts, couldn't we just have a single header that uses #if guards 
for the version specific functionality? e.g.

  size_t __attribute__((overloadable)) get_global_id(uint dim);
  
  #if __OPENCL_C_VERSION__ >= 200
  size_t __attribute__((overloadable)) get_global_linear_id(void);
  #endif

This also allows an easy path for having OpenCL 1.1 and 1.0 support without 
having to add more copies of the header.


http://reviews.llvm.org/D18369



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits