File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -210,14 +210,25 @@ function (set_compiler_flags target cpp_standard target_arch compiler_id)
210210 ${compiler_id} STREQUAL "GNU"
211211 OR ${compiler_id} STREQUAL "Clang"
212212 OR ${compiler_id} STREQUAL "AppleClang"
213- OR ${compiler_id} STREQUAL "NVIDIA"
214213 )
215214 if (${CMAKE_BUILD_TYPE} STREQUAL "Debug" OR ${CMAKE_BUILD_TYPE} STREQUAL "RelWithDebInfo" )
216215 target_compile_options (${target} PRIVATE "-O0;-g" )
217216 endif ()
218217 if (${CMAKE_BUILD_TYPE} STREQUAL "Release" OR ${CMAKE_BUILD_TYPE} STREQUAL "RelWithDebInfo" )
219218 target_compile_options (${target} PRIVATE "-O3" )
220219 endif ()
220+ elseif (${compiler_id} STREQUAL "NVIDIA" )
221+ if (${CMAKE_BUILD_TYPE} STREQUAL "Debug" OR ${CMAKE_BUILD_TYPE} STREQUAL "RelWithDebInfo" )
222+ target_compile_options (${target} PRIVATE "-O0;-g" )
223+ target_compile_options (${target} PRIVATE "-G;-no-compress" ) # for device code debug symbols
224+ target_compile_options (${target} PRIVATE "-Xptxas=-O0" ) # pass to the PTX assembler
225+ target_compile_options (${target} PRIVATE "-Xcompiler=-fno-omit-frame-pointer" )
226+ target_compile_options (${target} PRIVATE "-Xcompiler=-fno-inline" )
227+ target_compile_options (${target} PRIVATE "-maxrregcount=0" )
228+ endif ()
229+ if (${CMAKE_BUILD_TYPE} STREQUAL "Release" OR ${CMAKE_BUILD_TYPE} STREQUAL "RelWithDebInfo" )
230+ target_compile_options (${target} PRIVATE "-O3" )
231+ endif ()
221232 endif ()
222233
223234 # If available, enable Position Independent Code
You can’t perform that action at this time.
0 commit comments