How to disable a specific nvcc compiler warnings

It is actually possible to disable specific warnings on the device with NVCC. It took me ages to figure out how to do it.

You need to use the -Xcudafe flag combined with a token listed on this page. For example, to disable the “controlling expression is constant” warning, pass the following to NVCC:

-Xcudafe "--diag_suppress=boolean_controlling_expr_is_constant"

For other warnings, see the above link.

Leave a Comment