Written by
wano
on
on
How to enable C++17 in your MSVC CUDA project
The way to use C++17 in your MSVC CUDA project
-
Open your CUDA project in Visual Studio.
-
Right-click on your project in the Solution Explorer and select “Properties” from the context menu.
-
In the left-hand pane of the project properties window, select “CUDA C/C++” > “Command Line”.
-
Write the following in the additional options.
-std=c++17 -Xcompiler "/std:c++17"
If you encounter nvcc compilation warnings, write the following as additional options.
-std=c++17 -Xcompiler "/std:c++17" --expt-relaxed-constexpr -Xcudafe --diag_suppress=20012 -Xcudafe --diag_suppress=1394