Hi Tan,<br><br>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.<br>
<br><br>Gabriel<br><br><div class="gmail_quote">On Fri, Mar 18, 2011 at 11:54, Tan Chee Eng <span dir="ltr"><<a href="mailto:tance.e6p3f2@gmail.com">tance.e6p3f2@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hi,<div><br></div><div>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.</div>


<div><br></div><div>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.</div>


<div><br></div><div><br></div><div>Regards,</div><div>Chee Eng</div>
<br>_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br>
<br></blockquote></div><br>