<div dir="ltr">clang-tidy doesn't handle split host-device compilation. Something like<div><br></div><div>$ clang-tidy <a href="http://foo.cu">foo.cu</a> -- --cuda-host-only</div><div><br></div><div>Should work though.</div></div><br><div class="gmail_quote"><div dir="ltr">On Wed, Jul 4, 2018 at 1:32 PM Jakub Klener via cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>
<div id="m_-7292917812013613085smartTemplate4-template">
<p>Hi Jonas,<br>
<br>
yes, CUDA specifies few extensions to standard C++ but clang
started to support it a while ago, so I'm asking if it can be
also handled by clang-tidy. I posted example in the response to
the previous Richard's answer.<br>
<br>
Jakub <br>
</p>
</div>
<br>
<div id="m_-7292917812013613085smartTemplate4-quoteHeader">-----Original Message-----<br>
Subject: Re: [cfe-dev] clang-tidy and CUDA<br>
Sent: Wednesday, 4, 7. 2018 13:30<br>
From: <a class="m_-7292917812013613085moz-txt-link-abbreviated" href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a><br>
To: <a class="m_-7292917812013613085moz-txt-link-abbreviated" href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a></div>
<blockquote type="cite">
<pre>Please give more information how you use clang-tidy on your CUDA files.
There are currently no cuda specific checks in clang-tidy. I dont
program CUDA that much, but doesnt the CUDA compiler specify some extra
attributes and types in order to compile the device and host code?
Am 02.07.2018 um 23:29 schrieb Richard via cfe-dev:
</pre>
<blockquote type="cite">
<pre>[Please reply *only* to the list and do not include my email directly
in the To: or Cc: of your reply; otherwise I will not see your reply.
Thanks.]
In article <a class="m_-7292917812013613085moz-txt-link-rfc2396E" href="mailto:a8b5d138-3a78-de72-181a-5271fec64a47@eyen.eu" target="_blank"><a8b5d138-3a78-de72-181a-5271fec64a47@eyen.eu></a>,
Jakub Klener via cfe-dev <a class="m_-7292917812013613085moz-txt-link-rfc2396E" href="mailto:cfe-dev@lists.llvm.org" target="_blank"><cfe-dev@lists.llvm.org></a> writes:
</pre>
<blockquote type="cite">
<pre>is it somehow possible to specify source file extension for clang-tidy,
can it for example parse ".cu" files? Is there some support for CUDA in
clang-tidy? I ran it on my CUDA source file (which I have to rename to
".cc" file because otherwise clang-tidy could not find it), specified
-D__CUDACC__, and it found error: unknown type
name '__host__' [clang-diagnostic-error].
</pre>
</blockquote>
<pre>Are you using a compilation database or a command-line?
Either way, more information about exactly how you are invoking
clang-tidy is needed. AFAIK, clang-tidy doesn't care about the actual
filename.
</pre>
</blockquote>
<pre>
_______________________________________________
cfe-dev mailing list
<a class="m_-7292917812013613085moz-txt-link-abbreviated" href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>
<a class="m_-7292917812013613085moz-txt-link-freetext" href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a>
</pre>
</blockquote>
<div class="m_-7292917812013613085moz-signature">
<pre>* Jakub Klener
* Eyen SE
* Pocernicka 272/96
* 108 00 Prague
* Czech Republic
* <a class="m_-7292917812013613085moz-txt-link-freetext" href="http://www.eyen.eu/" target="_blank">http://www.eyen.eu/</a></pre>
</div>
</div>
_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><br>
</blockquote></div>