[cfe-dev] clang-tidy and CUDA

Benjamin Kramer via cfe-dev cfe-dev at lists.llvm.org
Wed Jul 4 05:28:42 PDT 2018


clang-tidy doesn't handle split host-device compilation. Something like

$ clang-tidy foo.cu -- --cuda-host-only

Should work though.

On Wed, Jul 4, 2018 at 1:32 PM Jakub Klener via cfe-dev <
cfe-dev at lists.llvm.org> wrote:

> Hi Jonas,
>
> 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.
>
> Jakub
>
> -----Original Message-----
> Subject: Re: [cfe-dev] clang-tidy and CUDA
> Sent: Wednesday, 4, 7. 2018 13:30
> From: cfe-dev at lists.llvm.org
> To: cfe-dev at lists.llvm.org
>
> 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:
>
> [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 <a8b5d138-3a78-de72-181a-5271fec64a47 at eyen.eu> <a8b5d138-3a78-de72-181a-5271fec64a47 at eyen.eu>,
>     Jakub Klener via cfe-dev <cfe-dev at lists.llvm.org> <cfe-dev at lists.llvm.org> writes:
>
>
> 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].
>
> 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.
>
>
> _______________________________________________
> cfe-dev mailing listcfe-dev at lists.llvm.orghttp://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>
> * Jakub Klener
> * Eyen SE
> * Pocernicka 272/96
> * 108 00 Prague
> * Czech Republic
> * http://www.eyen.eu/
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20180704/41963727/attachment-0001.html>


More information about the cfe-dev mailing list