Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 3 additions & 13 deletions cmake/public/cuda.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -364,20 +364,10 @@ endif()

# Debug and Release symbol support
if (MSVC)
if ((${CMAKE_BUILD_TYPE} MATCHES "Release") OR (${CMAKE_BUILD_TYPE} MATCHES "RelWithDebInfo") OR (${CMAKE_BUILD_TYPE} MATCHES "MinSizeRel"))
if (${CAFFE2_USE_MSVC_STATIC_RUNTIME})
list(APPEND CUDA_NVCC_FLAGS "-Xcompiler" "-MT")
else()
list(APPEND CUDA_NVCC_FLAGS "-Xcompiler" "-MD")
endif()
elseif(${CMAKE_BUILD_TYPE} MATCHES "Debug")
if (${CAFFE2_USE_MSVC_STATIC_RUNTIME})
list(APPEND CUDA_NVCC_FLAGS "-Xcompiler" "-MTd")
else()
list(APPEND CUDA_NVCC_FLAGS "-Xcompiler" "-MDd")
endif()
if (${CAFFE2_USE_MSVC_STATIC_RUNTIME})
list(APPEND CUDA_NVCC_FLAGS "-Xcompiler" "-MT$<$<CONFIG:Debug>:d>")
else()
message(FATAL_ERROR "Unknown cmake build type: " ${CMAKE_BUILD_TYPE})
list(APPEND CUDA_NVCC_FLAGS "-Xcompiler" "-MD$<$<CONFIG:Debug>:d>")
endif()
elseif (CUDA_DEVICE_DEBUG)
list(APPEND CUDA_NVCC_FLAGS "-g" "-G") # -G enables device code debugging symbols
Expand Down
6 changes: 0 additions & 6 deletions torch/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -270,12 +270,6 @@ target_compile_definitions(torch PUBLIC _THP_CORE)

# until they can be unified, keep these lists synced with setup.py
if(MSVC)
if (${CMAKE_BUILD_TYPE} MATCHES "Debug")
set (MSVC_RUNTIME_LIBRARY_FLAG "/MDd")
else()
set (MSVC_RUNTIME_LIBRARY_FLAG "/MD")
endif()

target_compile_options(torch PUBLIC
${MSVC_RUNTIME_LIBRARY_OPTION}
/Z7
Expand Down