[clang-tools-extra] [clang-tidy] Add documentation and smoke test for CUDA (PR #173699)
Carlos Galvez via cfe-commits
cfe-commits at lists.llvm.org
Sat Dec 27 10:50:54 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
----------------
carlosgalvezp wrote:
Is this really true? I believe I didn't need to use this to analyze device code.
https://github.com/llvm/llvm-project/pull/173699
More information about the cfe-commits
mailing list