[cfe-dev] Extent of CUDA support in clang as of 2.9-rc1

Gabriel Martinez mystal at vt.edu
Fri Mar 18 09:08:28 PDT 2011


Hi Tan,

The symbols __global__ and __shared__ are not actual tokens but instead
macros for the attributes global and shared. These are defined in headers
included by cuda_runtime.h. If you include that, clang should be able to
parse CUDA just fine.


Gabriel

On Fri, Mar 18, 2011 at 11:54, Tan Chee Eng <tance.e6p3f2 at gmail.com> wrote:

> Hi,
>
> I'm working on a CUDA source to source compiler which is using clang as
> it's frontend. I've read some of the messages on this mailing list which
> seems to indicate that CUDA support is on the way, and looking through the
> source for 2.9-rc1 shows signs that the AST should be able to handle at
> least some CUDA semantics.
>
> Unfortunately, when I do pass some CUDA code through my program, it clang
> throws parse errors on tokens such as __global__ and __shared__. In my
> initialization, I've set LangOptions.CUDA = 1. Did I miss something out, or
> is CUDA support in clang still incomplete? I've spent the better part of the
> last day looking through the docs and source trying to figure it out, and
> any help or pointers in the right direction would be very much appreciated.
>
>
> Regards,
> Chee Eng
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20110318/c0caa5fe/attachment.html>


More information about the cfe-dev mailing list