CUDA code coverage and Static analysis tools

I am looking following tools/Methods for CUDA kernel code.

  1. Static Analysis tool for CUDA Kernel code
  2. Code Coverage tool for CUDA Kernel code
  3. Best methods for writing Unit testing for CUDA kernels.
1 Like

I’m also interested on this question, what are the recommendations from Nvidia?

Hi guys, have you heard about ROSE or LLVM compiler infrastructures, I guess they offer interesting CUDA analysis tools.

Look inside of section 16.
http://www.rosecompiler.org/ROSE_UserManual/ROSE-0.9.9.149-UserManual.pdf

In the mean time if you guys have found some tools for CUDA please let me know.

BR
Diego.

Just came across this - there is now dedicated support for CUDA and NVIDIA CUDA Coding Guidelines in Qt’s Axivion Suite, which offers both static code analysis and architecture verification:

Qt also has a code coverage tool called Coco:

Hope this helps.

Regards,

Stefan

Yes! Axivion has the full support for the CUDA Coding Guidelines

Hey, Here are the some of the best available tools and methods for CUDA Kernel static analysis, code coverage and unit testing.

  1. Static Analysis for CUDA: These tools help you to find mistake in your CUDA kernel without running it.
  • NVIDIA Compute Sanitizer
  • Clang-Tidy
  • Cppcheck
  1. Code Coverage for CUDA: There is no perfect line coverage tool for GPU Kernel but you can use
  • Nsight Compute
  • Nsight System
  1. Unit Testing CUDA Kernels:
  • Use Google Test for writing tests.
  • Run the Kernel, then copy the output back to the CPU.
  • Then Compare this output with the correct expected result.
  • Also write a simple CPU version of the same code and compare GPU vs CPU results.
  • Test the different block sizes, grid sizes and edge case to make sure everything works.
1 Like

I think the Compute Sanitizer just must run the kernel (and traces it)