How to ignore unrecognized GCC pragma warning of CUDA


You have a GCC pragma in your CUDA code to ignore a specific warning produced by your code. While the GCC compiler uses this for the C++ section of the code, the CUDA compiler frontend complains about it with a warning: warning: unrecognized GCC pragma


To request the frontend of the CUDA compiler to ignore or hide this warning, pass this option during compilation:

-Xcudafe "--diag_suppress=unrecognized_gcc_pragma"

The GCC pragma warning should be hidden now.

Tried with: CUDA 5.5, GCC 4.8 and Ubuntu 12.04

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.