Oh, yeah. idk why but I got the impression that you were trying to get it to work while keeping the cuda call syntax (I haven't done any cuda programming, but the alternative to the cuda call syntax in the example you gave seemed painful to write), even though you explicitly said "<span style="font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">Is there a way to disable parsing </span><span style="font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">of the CUDA call syntax <<< >>>?"</span><div>
<font face="arial, sans-serif"><br></font></div><div><font face="arial, sans-serif">D'oh.</font></div><div><font face="arial, sans-serif"><br></font></div><div><font face="arial, sans-serif">--Sean Silva<br></font><br>
<div class="gmail_quote">On Thu, Jun 14, 2012 at 7:53 AM, Peter Colberg <span dir="ltr"><<a href="mailto:peter@colberg.org" target="_blank">peter@colberg.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">On Wed, Jun 13, 2012 at 09:35:10PM -0700, Sean Silva wrote:<br>
> On Wed, Jun 13, 2012 at 8:28 PM, Peter Colberg <<a href="mailto:peter@colberg.org">peter@colberg.org</a>> wrote:<br>
</div><div class="im">> > The parser interprets the compressed C++11 template parameter syntax<br>
> > as a call to a CUDA kernel function. Is there a way to disable parsing<br>
> > of the CUDA call syntax <<< >>>? I would be using a C++ wrapper around<br>
> > cudaConfigureCall, cudaSetupArgument and cudaLaunch anyway.<br>
><br>
</div><div class="im">> Try:<br>
><br>
> find $HEADER_DIR | xargs sed --i.bak -e 's/>>>/> > >/'<br>
><br>
> I don't think there are any syntactic dark corners where that will break<br>
> otherwise valid C++.<br>
><br>
> No guarantees though (that's what the -i.bak is for ;).<br>
<br>
</div>The other way around: CUDA violates the C++ standard with regard to<br>
template parameter syntax, so I would like to disable the CUDA<br>
execution syntax, and use cudaLaunch with a pointer instead.<br>
<br>
The lexer of Clang is straight-forward :-).<br>
<br>
--- lib/Lex/Lexer.cpp 2012-06-14 10:48:34.675569175 -0400<br>
+++ lib/Lex/Lexer.cpp 2012-06-14 10:48:51.246645348 -0400<br>
@@ -3054,10 +3054,6 @@<br>
// If this is '<<<<' and we're in a Perforce-style conflict marker,<br>
// ignore it.<br>
goto LexNextToken;<br>
- } else if (LangOpts.CUDA && After == '<') {<br>
- Kind = tok::lesslessless;<br>
- CurPtr = ConsumeChar(ConsumeChar(CurPtr, SizeTmp, Result),<br>
- SizeTmp2, Result);<br>
} else {<br>
CurPtr = ConsumeChar(CurPtr, SizeTmp, Result);<br>
Kind = tok::lessless;<br>
@@ -3110,10 +3106,6 @@<br>
} else if (After == '>' && HandleEndOfConflictMarker(CurPtr-1)) {<br>
// If this is '>>>>>>>' and we're in a conflict marker, ignore it.<br>
goto LexNextToken;<br>
- } else if (LangOpts.CUDA && After == '>') {<br>
- Kind = tok::greatergreatergreater;<br>
- CurPtr = ConsumeChar(ConsumeChar(CurPtr, SizeTmp, Result),<br>
- SizeTmp2, Result);<br>
} else {<br>
CurPtr = ConsumeChar(CurPtr, SizeTmp, Result);<br>
Kind = tok::greatergreater;<br>
<div class="HOEnZb"><div class="h5"><br>
Peter<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>
</div></div></blockquote></div><br></div>