-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Non C++17 CUDA compilation is broken when STL headers are included #2020
Comments
We have indeed switched completely to using This should be fine as it only results in a warning that is suppressed project wide. Are you sure you are using a supported Version of CUDA? AFAIK we require 10.2 |
In the CUDA installation guide it's said that CUDA 11.3 is supported by Visual Studio 2019 16.x on x86_64 systems. I'm using CUDA 11.3.109. |
Did you pass the required |
It's said that |
Because |
Right, it's the motivation for the |
|
Is there documentation that states that this option enables |
Strange. It looks fine for me in the compiler explorer: (I have not installed CUDA Toolkit yet) |
Godbolt uses GCC. I don't have any issues with GCC build. |
@senior-zero.
Default Cuda Project from Visual Studio 2019 Community 16.10.2 also builds fine. |
Our test coverage currently uses CUDA 10.1 Update 2 in C++14 mode (it didn't support C++17) without any special flags to enable Line 555 in 1866b84
If this isn't working in CUDA 11.3 and @fsb4000 can't repro, then we'll need to find out what the necessary conditions for the repro are. |
Hello @StephanTLavavej, @fsb4000! The build is successful when it's launched from VS indeed. I use CMake and specify CMAKE_CUDA_STANDARD, which leads to an additional option being passed to nvcc |
@senior-zero , @StephanTLavavej
I tried to build with same command but without When we change MSBuild C++ language to C++14, it does not add the flag to nvcc |
cmake default generator also creates bad sln. (with
|
I found the same issue in the Devcom: https://developercommunity.visualstudio.com/t/VS-16100-isnt-compatible-with-CUDA-11/1433342 It marked as regression
Strange... |
Thanks for finding the cause - we'll need to contact NVIDIA and ask them whether this is a regression that they can fix on their side. |
I suppose we've found out that it's not STL related question, so I'm closing the issue. Thank you all! |
@senior-zero
|
did this get resolved? |
Hello, I'm using fresh VS install (16.10.2). When I compile the following code sample everything is fine:
But STL usage:
leads to the following compilation errors
If I change the standard version to C++17 - everything works fine. It seems that there is an unguarded
if constexpr
usage in the STL.The text was updated successfully, but these errors were encountered: