зеркало из https://github.com/microsoft/LightGBM.git
[ci] simplify processing of `CMAKE_CUDA_FLAGS` variable in `CMakeLists.txt` (#4799)
* Update CMakeLists.txt * Update cuda.yml * Update CMakeLists.txt * Update CMakeLists.txt * Update cuda.yml
This commit is contained in:
Родитель
5b587333da
Коммит
968c60c5a4
|
@ -174,7 +174,7 @@ endif()
|
|||
if(USE_CUDA)
|
||||
find_package(CUDA 9.0 REQUIRED)
|
||||
include_directories(${CUDA_INCLUDE_DIRS})
|
||||
LIST(APPEND CMAKE_CUDA_FLAGS -Xcompiler=${OpenMP_CXX_FLAGS} -Xcompiler=-fPIC -Xcompiler=-Wall)
|
||||
set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -Xcompiler=${OpenMP_CXX_FLAGS} -Xcompiler=-fPIC -Xcompiler=-Wall")
|
||||
|
||||
set(CUDA_ARCHS "6.0" "6.1" "6.2" "7.0")
|
||||
if(CUDA_VERSION VERSION_GREATER_EQUAL "10.0")
|
||||
|
@ -189,14 +189,14 @@ if(USE_CUDA)
|
|||
list(POP_BACK CUDA_ARCHS CUDA_LAST_SUPPORTED_ARCH)
|
||||
list(APPEND CUDA_ARCHS "${CUDA_LAST_SUPPORTED_ARCH}+PTX")
|
||||
CUDA_SELECT_NVCC_ARCH_FLAGS(CUDA_ARCH_FLAGS ${CUDA_ARCHS})
|
||||
string(REPLACE ";" " " CUDA_ARCH_FLAGS "${CUDA_ARCH_FLAGS}")
|
||||
|
||||
LIST(APPEND CMAKE_CUDA_FLAGS ${CUDA_ARCH_FLAGS})
|
||||
set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} ${CUDA_ARCH_FLAGS}")
|
||||
if(USE_DEBUG)
|
||||
SET(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -g")
|
||||
else()
|
||||
SET(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -O3 -lineinfo")
|
||||
endif()
|
||||
string(REPLACE ";" " " CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS}")
|
||||
message(STATUS "CMAKE_CUDA_FLAGS: ${CMAKE_CUDA_FLAGS}")
|
||||
|
||||
ADD_DEFINITIONS(-DUSE_CUDA)
|
||||
|
|
Загрузка…
Ссылка в новой задаче