Search code examples
cudacompiler-warningsnvcc

What's the NVCC warning token for " 'long double' is treated as 'double' in device code"?


In this question:

How to disable a specific nvcc compiler warnings

there's a link to a long "dictionary" mapping tokens to error messages, which seems to fit NVCC ... except it doesn't cover all warnings. Specifically, I want to suppress

warning: 'long double' is treated as 'double' in device code

... and that warning isn't in there. What's the token for it? Or perhaps - how can I determine the token given a warning string?

Note: AFAICT, it's not

"double" used for "long double" in generated C code

which is very similar.


Solution

  • The number of that warning is 20208; thus, it will be suppressed if you append the following to your compilation command-line:

    -Xcudafe --diag_suppress=20208
    

    I figured this out thanks to this answer, which explains how you can get NVCC to emit warning numbers.

    However - this doesn't work:

    #pragma diag_suppress = 20208
    

    so the syntax for suppressing errors by number within the code must be different.


    Note: Don't mistake diag-suppress for diag_suppress.