Windows vs2015 creates a cuda project, and the /Zi option is turned on by default in release mode. How to remove it?

  1. I create a cuda project through vs2015 (The code for vector_add is automatically created).

  1. Set release mode

  2. Open the property page, observe the compilation options, and notice that /Zi is set by default

  1. The corresponding compilation options are

    “D:\NVIDIA GPU Computing Toolkit\CUDA\v10.0\bin\nvcc.exe” -gencode=arch=compute_35,code=“sm_35,compute_35” --use-local-env -ccbin “C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64” -x cu -I"D:\NVIDIA GPU Computing Toolkit\CUDA\v10.0\include" -I"D:\NVIDIA GPU Computing Toolkit\CUDA\v10.0\include" --keep-dir x64\Release -maxrregcount=0 --machine 64 --compile -cudart static -DWIN32 -DWIN64 -DNDEBUG -D_CONSOLE -D_MBCS -Xcompiler "/EHsc /W3 /nologo /O2 /Fdx64\Release\vc140.pdb /FS /Zi /MD " -o x64\Release\ “C:\Users\paddle-ci\Desktop\test\test1\”

The size of the generated obj is 74 kb.

In the command line, remove /Zi and compile directly, the size of the generated .obj is 34 kb.

On some occasions, we eagerly hope that the obj size becomes smaller, and we hope to find a way to remove /Zi.

Environment: windows10 + vs2015