I get the warning controlling expression is constant
on assert statement like this:
assert(... && \"error message\");
I ran into this exact problem and finally found a way to disable warnings on the device. Here are the details...
To disable a specific warning, you need to use the -Xcudafe flag combined with a token listed on this page (http://www.ssl.berkeley.edu/~jimm/grizzly_docs/SSL/opt/intel/cc/9.0/lib/locale/en_US/mcpcom.msg). For example, to disable the "controlling expression is constant" warning, pass the following to NVCC:
-Xcudafe "--diag_suppress=boolean_controlling_expr_is_constant"
This worked for me! For other warnings, see the above link.