I am trying to compile a kernel in VS2005 using device emulation:
$(CUDA_BIN_PATH)\nvcc.exe -ccbin “$(VCInstallDir)bin” -deviceemu -c -D_DEBUG -DWIN32 -D_CONSOLE -D_MBCS -Xcompiler /EHsc,/W3,/nologo,/Wp64,/Od,/Zi,/RTC1,/MDd -I"$(CUDA_INC_PATH)" -I./ -I…/…/common/inc -o $(PlatformName)$(ConfigurationName)$(InputName).obj $(InputPath)
But I got these compilation errors:
1>cudaKernels.cu
1>g:\cuda2\include\common_functions.h(56): warning: dllexport/dllimport conflict
1> with “clock” (declared at line 176 of
1> “G:/vs2k5/VC/bin/…\INCLUDE\time.h”); dllimport/dllexport dropped
1>g:\cuda2\include\common_functions.h(56): warning: dllexport/dllimport conflict
1> with “clock” (declared at line 176 of
1> “G:/vs2k5/VC/bin/…\INCLUDE\time.h”); dllimport/dllexport dropped
1>g:\cuda2\include\math_functions.h(96) : error C2201: ‘__cuda_sinf’ : must have external linkage in order to be exported/imported
1>g:\cuda2\include\math_functions.h(101) : error C2201: ‘__cuda_cosf’ : must have external linkage in order to be exported/imported
1>g:\cuda2\include\math_functions.h(111) : error C2201: ‘__cuda_tanf’ : must have external linkage in order to be exported/imported
1>g:\cuda2\include\math_functions.h(116) : error C2201: ‘__cuda_sqrtf’ : must have external linkage in order to be exported/imported
1>g:\cuda2\include\math_functions.h(146) : error C2201: ‘__cuda_log10f’ : must have external linkage in order to be exported/imported
1>g:\cuda2\include\math_functions.h(151) : error C2201: ‘__cuda_logf’ : must have external linkage in order to be exported/imported
1>g:\cuda2\include\math_functions.h(159) : error C2201: ‘__cuda_floor’ : must have external linkage in order to be exported/imported
1>g:\cuda2\include\math_functions.h(161) : error C2201: ‘__cuda_floorf’ : must have external linkage in order to be exported/imported
1>g:\cuda2\include\math_functions.h(166) : error C2201: ‘__cuda_expf’ : must have external linkage in order to be exported/imported
1>g:\cuda2\include\math_functions.h(171) : error C2201: ‘__cuda_coshf’ : must have external linkage in order to be exported/imported
1>g:\cuda2\include\math_functions.h(176) : error C2201: ‘__cuda_sinhf’ : must have external linkage in order to be exported/imported
1>g:\cuda2\include\math_functions.h(181) : error C2201: ‘__cuda_tanhf’ : must have external linkage in order to be exported/imported
1>g:\cuda2\include\math_functions.h(199) : error C2201: ‘__cuda_ldexp’ : must have external linkage in order to be exported/imported
1>g:\cuda2\include\math_functions.h(224) : error C2201: ‘__cuda_frexp’ : must have external linkage in order to be exported/imported
1>g:\cuda2\include\math_functions.h(264) : error C2201: ‘__cuda_ceil’ : must have external linkage in order to be exported/imported
1>g:\cuda2\include\math_functions.h(266) : error C2201: ‘__cuda_ceilf’ : must have external linkage in order to be exported/imported
1>g:\cuda2\include\math_functions.h(281) : error C2201: ‘__cuda_atan2f’ : must have external linkage in order to be exported/imported
1>g:\cuda2\include\math_functions.h(286) : error C2201: ‘__cuda_atanf’ : must have external linkage in order to be exported/imported
1>g:\cuda2\include\math_functions.h(291) : error C2201: ‘__cuda_asinf’ : must have external linkage in order to be exported/imported
1>g:\cuda2\include\math_functions.h(296) : error C2201: ‘__cuda_acosf’ : must have external linkage in order to be exported/imported
1>g:\cuda2\include\math_functions.h(299) : error C2201: ‘__cuda_hypot’ : must have external linkage in order to be exported/imported
1>g:\cuda2\include\math_functions.h(311) : error C2201: ‘__cuda_powf’ : must have external linkage in order to be exported/imported
1>g:\cuda2\include\math_functions.h(314) : error C2201: ‘__cuda_modf’ : must have external linkage in order to be exported/imported
1>g:\cuda2\include\math_functions.h(316) : error C2201: ‘__cuda_modff’ : must have external linkage in order to be exported/imported
1>g:\cuda2\include\math_functions.h(321) : error C2201: ‘__cuda_fmodf’ : must have external linkage in order to be exported/imported
1>g:\cuda2\include\math_functions.h(1110) : error C2491: ‘__cuda_ceilf’ : definition of dllimport function not allowed
1>g:\cuda2\include\math_functions.h(1115) : error C2491: ‘__cuda_floorf’ : definition of dllimport function not allowed
1>g:\cuda2\include\math_functions.h(1120) : error C2491: ‘__cuda_sqrtf’ : definition of dllimport function not allowed
1>g:\cuda2\include\math_functions.h(1735) : error C2491: ‘__cuda_sinf’ : definition of dllimport function not allowed
1>g:\cuda2\include\math_functions.h(1746) : error C2491: ‘__cuda_cosf’ : definition of dllimport function not allowed
1>g:\cuda2\include\math_functions.h(1774) : error C2491: ‘__cuda_tanf’ : definition of dllimport function not allowed
1>g:\cuda2\include\math_functions.h(1808) : error C2491: ‘__cuda_expf’ : definition of dllimport function not allowed
1>g:\cuda2\include\math_functions.h(1830) : error C2491: ‘__cuda_coshf’ : definition of dllimport function not allowed
1>g:\cuda2\include\math_functions.h(1843) : error C2491: ‘__cuda_sinhf’ : definition of dllimport function not allowed
1>g:\cuda2\include\math_functions.h(1868) : error C2491: ‘__cuda_tanhf’ : definition of dllimport function not allowed
1>g:\cuda2\include\math_functions.h(1892) : error C2491: ‘__cuda_atan2f’ : definition of dllimport function not allowed
1>g:\cuda2\include\math_functions.h(1929) : error C2491: ‘__cuda_atanf’ : definition of dllimport function not allowed
1>g:\cuda2\include\math_functions.h(1965) : error C2491: ‘__cuda_asinf’ : definition of dllimport function not allowed
1>g:\cuda2\include\math_functions.h(1982) : error C2491: ‘__cuda_acosf’ : definition of dllimport function not allowed
1>g:\cuda2\include\math_functions.h(1999) : error C2491: ‘__cuda_logf’ : definition of dllimport function not allowed
1>g:\cuda2\include\math_functions.h(2010) : error C2491: ‘__cuda_log10f’ : definition of dllimport function not allowed
1>g:\cuda2\include\math_functions.h(2360) : error C2491: ‘__cuda_modff’ : definition of dllimport function not allowed
1>g:\cuda2\include\math_functions.h(2382) : error C2491: ‘__cuda_fmodf’ : definition of dllimport function not allowed
1>g:\cuda2\include\math_functions.h(2951) : error C2491: ‘__cuda_powf’ : definition of dllimport function not allowed
1>g:\cuda2\include\math_functions_dbl_ptx1.h(91) : error C2491: ‘__cuda_ceil’ : definition of dllimport function not allowed
1>g:\cuda2\include\math_functions_dbl_ptx1.h(101) : error C2491: ‘__cuda_floor’ : definition of dllimport function not allowed
1>g:\cuda2\include\math_functions_dbl_ptx1.h(226) : error C2491: ‘__cuda_hypot’ : definition of dllimport function not allowed
1>g:\cuda2\include\math_functions_dbl_ptx1.h(256) : error C2491: ‘__cuda_ldexp’ : definition of dllimport function not allowed
1>g:\cuda2\include\math_functions_dbl_ptx1.h(271) : error C2491: ‘__cuda_frexp’ : definition of dllimport function not allowed
1>g:\cuda2\include\math_functions_dbl_ptx1.h(276) : error C2491: ‘__cuda_modf’ : definition of dllimport function not allowed
If I remove the “-deviceemu” all works ok. What I need to do to compile it using device emulation pls? I’m trying to compile a C++ x64 DLL btw.