[clang-tools-extra] [clang-tidy] Add documentation and smoke test for CUDA (PR #173699)

via cfe-commits cfe-commits at lists.llvm.org
Sun Dec 28 02:17:12 PST 2025


================
@@ -349,6 +349,25 @@ 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>`_.
+
+.. code-block:: console
+
+  $ clang-tidy source.cu -- --cuda-path=/path/to/cuda
+
+By default, :program:`clang-tidy` will compile the code for the host. To
----------------
zeyi2 wrote:

Sorry that I made the mistake. I've updated the doc, but I'm still not sure whether I document the argument correctly. Would you please take another look when you have time? Thanks :)

https://github.com/llvm/llvm-project/pull/173699


More information about the cfe-commits mailing list