[cfe-dev] OpenCL and Type Poisoning

Speziale Ettore speziale.ettore at gmail.com
Tue Feb 8 09:03:28 PST 2011


Hi,

I attach the proposed patch for parsing and validating OpenCL kernel
functions. The patch is composed by:

* "kernel" keyword handling:
  the code comes from lates Anton's pathches. Since I have seen that 
  the ARM patch is not yet been merged in the main tree, I have 
  extrapolated the portion about the "kernel" keyword, and I have based 
  my work on this
* "opencl_kernel_poison" attribute:
  can be attached to a typedef definition to mark the defined type, and 
  derived ones, unusable as kernel param types
* kernel function semantic checking:
  kernel function has been checked for correct return value and for 
  param types (OpenCL 1.1 Specs, 6.8.k). Checking for half data type
  has not been implemented
* OpenCL header:
  that header should define OpenCL derived types, such as size_t and 
  vector types. For now, if defines size_t, ptrdiff_t, [u]intptr_t.
  I have preferred using a custom header instead of stddef and stdint
  to not incure in namespace pollution
* tests:
  I have added some test to check the proposed extension

Notes:
I have found a family of functions (Require*) in clang::Sema
implementing custom checking. I have implemented the checking for the
OpenCLKernelAttr attribute in a similar way.

I hope this patch will be usefull for the clang community. It was for
me.
Best regards,
speziale.ettore at gmail.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: anton-kernel-02-08-2011.diff
Type: text/x-patch
Size: 15044 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20110208/0b459545/attachment.bin>


More information about the cfe-dev mailing list