how to enable c++11 in nvcc for visual studio 14 (2015) ??

Dear experts,

I was using cuda 9.0 + visual studio 14 (2015) before the following warning message popped up:

2>CUSTOMBUILD : nvcc warning : The -std=c++11 flag is not supported with the configured host compiler. Flag will be ignored.

Turns out visual studio has no notion of standard level, as is stated in That’s really a pickle. So is there any possibility that I could use c++11 + cuda + visual studio for my device code? Thanks.

Visual Studio already supports particular c++ levels by default, without the need for a switch, and for those cases, the corresponding support is available in the device code, without the need for a switch, for c++11.

So, just to pick one example, you should not have to do anything special in device code to use the c++11 auto keyword, for recent versions of CUDA and their supported VS versions.

In other words, with g++, you need to explicitly specify -std=c++11. With VS, you do not need to do it. Support is automatic, for any CUDA version that supports c++11, used with a supported VS version.