================
@@ -349,6 +349,36 @@ An overview of all the command-line options:
         some-check.SomeOption: 'some value'
       ...
 
+Running Clang-Tidy on CUDA Files
+--------------------------------
+
+:program:`clang-tidy` supports analyzing CUDA source files. To ensure correct
+header resolution, it is important to specify the CUDA toolkit path using
+``--cuda-path``. For more details on how Clang handles CUDA, see
+`Compiling CUDA with Clang <https://llvm.org/docs/CompileCudaWithLLVM.html>`_.
+
+If you are using a GCC + NVCC build setup, the compiler command database will
+contain NVCC-specific flags that :program:`clang-tidy` does not understand.
+
+In this case, you should use the ``RemovedArgs`` configuration option (or
+``--removed-arg`` command-line option) to remove these flags, and
+``ExtraArgs`` (or ``--extra-arg``) to provide the ``--cuda-path``.
+
+For example, to remove the NVCC-specific ``-gencode`` flag and provide the
+CUDA path:
+
+.. code-block:: console
+
+  $ clang-tidy source.cu --removed-arg="-gencode" --removed-arg="arch=.." 
--extra-arg="--cuda-path=/path/to/cuda"
+
+By default, :program:`clang-tidy` will use the host compilation, which is
----------------
vbvictor wrote:

While proof-reading, got a little confused by "host compilation". Can we 
rephrase it somehow better?
So clang-tidy will use host compilation flags or from compiler database or..?
And later write "specifically chose device compilation flags".

P.S. Maybe my assumptions are incorrect at all..

https://github.com/llvm/llvm-project/pull/173699
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to