Commit d5b6684a authored by Tobias Winchen's avatar Tobias Winchen
Browse files

Fix compile flags for debug mode

parent 48258b57
......@@ -15,22 +15,23 @@ if(ENABLE_CUDA)
# Pass options to NVCC ( -ccbin /path --compiler-options -lfftw3f --compiler-options -lm --verbose)
list(APPEND CUDA_NVCC_FLAGS -DENABLE_CUDA --std c++${CMAKE_CXX_STANDARD} -Wno-deprecated-gpu-targets --ptxas-options=-v)
list(APPEND CUDA_NVCC_FLAGS_DEBUG --debug; --device-debug; --generate-line-info -Xcompiler "-Wextra" -Xcompiler "-Werror")
list(APPEND CUDA_NVCC_FLAGS_DEBUG --debug --generate-line-info -Xcompiler "-Wextra") # Do not use Xcompiler -Werror here as it prevents some kernels from execution
#list(APPEND CUDA_NVCC_FLAGS_DEBUG --debug --device-debug -Xcompiler "-Wextra" -Xcompiler "-Werror")
list(APPEND CUDA_NVCC_FLAGS_PROFILE --generate-line-info)
#list(APPEND CUDA_NVCC_FLAGS -arch compute_35) # minumum compute level (Sps restriction)
string(TOUPPER "${CMAKE_BUILD_TYPE}" uppercase_CMAKE_BUILD_TYPE)
if(NOT uppercase_CMAKE_BUILD_TYPE MATCHES "DEBUG")
message("Enabling device specific compilation as not in DEBUG mode")
message("Enabling device specific compilation as not in DEBUG mode")
list(APPEND CUDA_NVCC_FLAGS -gencode arch=compute_61,code=sm_61) # GTX1080Ti, Titan Xp
list(APPEND CUDA_NVCC_FLAGS -gencode arch=compute_61,code=compute_61) # Compatibility
#list(APPEND CUDA_NVCC_FLAGS -gencode arch=compute_52,code=sm_52) # TitanX
#list(APPEND CUDA_NVCC_FLAGS -gencode arch=compute_50,code=sm_50) # Maxwell
#list(APPEND CUDA_NVCC_FLAGS -gencode arch=compute_37,code=sm_37) # K80
if(CUDA_VERSION VERSION_GREATER 10.0)
list(APPEND CUDA_NVCC_FLAGS -gencode arch=compute_75,code=sm_75) # RTX2080, CUDA10
endif()
endif(NOT uppercase_CMAKE_BUILD_TYPE MATCHES "DEBUG")
if(CUDA_VERSION VERSION_GREATER 10.0)
list(APPEND CUDA_NVCC_FLAGS -gencode arch=compute_75,code=sm_75) # RTX2080, CUDA10
endif()
list(APPEND CUDA_NVCC_FLAGS -O3 -use_fast_math -restrict)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment