There is some C++ code in a CUDA file that uses this pragma:
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-result"
void foobar()
{
// some code
}
#pragma GCC diagnostic pop
When this CUDA file is compiled using CUDA 5.5 nvcc compiler, the host compiler stage is fine, but the device compiler stage produces this warning:
foobar.cu(420): warning: unrecognized GCC pragma
It looks like the CUDA compiler understands that this is a GCC pragma. I have no idea why it is trying to understand all GCC pragmas. Is there any method to fix this warning or make this warning go away?
Update: Please note that passing the -Xcudafe "--diag_suppress=unrecognized_pragma"
option to the nvcc compiler does not seem to have any effect.