Skip to content

Commit

Permalink
[1.x] Backport Add cmake flag USE_FATBIN_COMPRESSION, ON by default (a…
Browse files Browse the repository at this point in the history
…pache#19123) (apache#19158)

* [1.x] Backport Add cmake flag USE_FATBIN_COMPRESSION, ON by default (apache#19123)

* Trigger CI

* Appending to existing CMAKE_CUDA_FLAGS in all cases
  • Loading branch information
DickJC123 committed Sep 18, 2020
1 parent 25ab7a6 commit 74fae76
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -634,8 +634,8 @@ endif()
add_subdirectory("3rdparty/mshadow")

if(USE_CUDA AND USE_FATBIN_COMPRESSION)
string(APPEND CMAKE_CUDA_FLAGS "--fatbin-options -compress-all ")
message("-- CUDA: Adding NVCC options: --fatbin-options -compress-all ")
string(APPEND CMAKE_CUDA_FLAGS " --fatbin-options --compress-all")
message("-- CUDA: Adding NVCC options: --fatbin-options --compress-all")
endif()
if(UNIX)
string(APPEND CMAKE_CUDA_FLAGS " ${CUDA_ARCH_FLAGS_SPACES}")
Expand Down Expand Up @@ -710,7 +710,7 @@ elseif(MSVC)
COMMAND gen_warp $<TARGET_FILE:mxnet_${mxnet_first_arch}> WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/ DEPENDS $<TARGET_FILE:mxnet_${mxnet_first_arch}>)
else(USE_SPLIT_ARCH_DLL)
string(REPLACE ";" " " NVCC_FLAGS_ARCH "${NVCC_FLAGS_ARCH}")
set(CMAKE_CUDA_FLAGS " ${CUDA_ARCH_FLAGS_SPACES}")
string(APPEND CMAKE_CUDA_FLAGS " ${CUDA_ARCH_FLAGS_SPACES}")
add_library(mxnet SHARED ${SOURCE})
target_link_libraries(mxnet PUBLIC mshadow)
target_compile_options(
Expand Down

0 comments on commit 74fae76

Please sign in to comment.