Search code examples
cudawarningsnvcc

How to disable all unwanted nvcc compiler warnings


I'm getting so many warnings at the nvcc compiler such as "was set but never used ", "was declared but never referenced", "expression has no effect" etc. In one post, someone suggested brute force #prgma for each warning. This is impractical because I have so many warnings. I tried -w, but that didn't work. In another post, someone suggested -Xcompiler "-w" , but that didn't work for me either. How can I suppress all nvcc warnings?


Solution

  • As per the documentation, --disable-warnings or -w will disable all nvcc (technically CUDA toolchain) generated warnings. As a rule, I counsel against ignoring compiler warnings. They exist for a reason.