allendaicool / thrust

Automatically exported from code.google.com/p/thrust
Apache License 2.0
0 stars 0 forks source link

CUDA 2.3: MSVC9: version.cu example generates "nonstandard extension" warning when C runtime DLL used #45

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
This happens for me in WinXP 32-bit, but I suspect other windows versions 
will be the same.

What steps will reproduce the problem?
1. Create a new MSVC project.
2. Use the following command line to compile (/MDd means "Multithreaded 
Debug DLL" runtime library. Without this there are no warnings).  

"F:\CUDA\bin\nvcc.exe"    -arch sm_10 -ccbin "f:\Program Files\Microsoft 
Visual Studio 9.0\VC\bin"    -Xcompiler "/EHsc /W3 /nologo /Od /Zi   /MDd  
" -I"F:\CUDA\include/thrust" -maxrregcount=32  --compile -o 
"Debug\version.cu.obj" "f:\CUDA\include\thrust\examples\version.cu" 

(Note my thrust is from SVN and the thrust include directory is 
F:\CUDA\include\thrust\thrust, so I use -I$(CUDA_INC_PATH)/thrust in the 
project settings.

Alternatively use the CUDA SDK 2.3 cuda.rules file and add "Multithreaded 
Debug DLL" option under "Hybrid CUDA/C++ Options".

3. Compile.

What is the expected output? What do you see instead?

Expected: no errors, no warnings.
I get this output:

1>Compiling with CUDA Build Rule...
1>"F:\CUDA\bin\nvcc.exe"    -arch sm_10 -ccbin "f:\Program Files\Microsoft 
Visual Studio 9.0\VC\bin"    -Xcompiler "/EHsc /W3 /nologo /Od /Zi   /MDd  
" -I"F:\CUDA\include/thrust" -maxrregcount=32  --compile -o 
"Debug\version.cu.obj" "f:\CUDA\include\thrust\examples\version.cu" 
1>version.cu
1>tmpxft_00000d18_00000000-3_version.cudafe1.gpu
1>tmpxft_00000d18_00000000-8_version.cudafe2.gpu
1>tmpxft_00000d18_00000000-3_version.cudafe1.cpp
1>tmpxft_00000d18_00000000-12_version.ii
1>f:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\istream(1139) : 
warning C4231: nonstandard extension used : 'extern' before template 
explicit instantiation
1>f:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\istream(1141) : 
warning C4231: nonstandard extension used : 'extern' before template 
explicit instantiation
1>f:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\istream(1143) : 
warning C4231: nonstandard extension used : 'extern' before template 
explicit instantiation
1>f:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\istream(1145) : 
warning C4231: nonstandard extension used : 'extern' before template 
explicit instantiation
1>f:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\istream(1147) : 
warning C4231: nonstandard extension used : 'extern' before template 
explicit instantiation
1>f:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\istream(1149) : 
warning C4231: nonstandard extension used : 'extern' before template 
explicit instantiation
1>f:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\istream(1151) : 
warning C4231: nonstandard extension used : 'extern' before template 
explicit instantiation
1>f:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\istream(1153) : 
warning C4231: nonstandard extension used : 'extern' before template 
explicit instantiation
1>Build log was saved at 
"file://f:\CUDA\include\thrust\examples\version\Debug\BuildLog.htm"
1>version - 0 error(s), 8 warning(s)

What version of the product are you using? On what operating system?

Thrust from SVN r521.

Please provide any additional information below.

Original issue reported on code.google.com by harr...@gmail.com on 5 Oct 2009 at 2:44

GoogleCodeExporter commented 9 years ago
I think this is nvcc's bug.  The following code which doesn't rely on Thrust 
also 
produces it:

#include <istream>

int main(void) {return 0;}

c:\dev\svn\thrust>nvcc -Xcompiler "/EHsc /W3 /nologo /Od /Zi   /MDd" test.cu
test.cu
tmpxft_00000ec4_00000001-3_test.cudafe1.gpu
tmpxft_00000ec4_00000001-8_test.cudafe2.gpu
tmpxft_00000ec4_00000001-3_test.cudafe1.cpp
tmpxft_00000ec4_00000001-12_test.ii
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\istream(1139) : warning 
C4231: nonstandard extension used : 'extern' before template explicit 
instantiation
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\istream(1141) : warning 
C4231: nonstandard extension used : 'extern' before template explicit 
instantiation
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\istream(1143) : warning 
C4231: nonstandard extension used : 'extern' before template explicit 
instantiation
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\istream(1145) : warning 
C4231: nonstandard extension used : 'extern' before template explicit 
instantiation
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\istream(1147) : warning 
C4231: nonstandard extension used : 'extern' before template explicit 
instantiation
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\istream(1149) : warning 
C4231: nonstandard extension used : 'extern' before template explicit 
instantiation
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\istream(1151) : warning 
C4231: nonstandard extension used : 'extern' before template explicit 
instantiation
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\istream(1153) : warning 
C4231: nonstandard extension used : 'extern' before template explicit 
instantiation

It compiles with cl.exe alone without warning.

Original comment by jaredhoberock on 5 Oct 2009 at 6:59

GoogleCodeExporter commented 9 years ago
marking as not a bug.

Original comment by jaredhoberock on 6 Oct 2009 at 6:20