提交 b1cd8680 编写于 作者: P peizhilin

Merge branch 'windows/build' into windows/online

test=develop
...@@ -133,6 +133,8 @@ endif() ...@@ -133,6 +133,8 @@ endif()
if (WIN32) if (WIN32)
set(WITH_AVX OFF CACHE STRING set(WITH_AVX OFF CACHE STRING
"Disable AVX when compiling for Windows" FORCE) "Disable AVX when compiling for Windows" FORCE)
set(WITH_DSO OFF CACHE STRING
"Disable DSO when compiling for Windows" FORCE)
endif() endif()
set(THIRD_PARTY_PATH "${CMAKE_BINARY_DIR}/third_party" CACHE STRING set(THIRD_PARTY_PATH "${CMAKE_BINARY_DIR}/third_party" CACHE STRING
......
...@@ -195,7 +195,7 @@ endfunction() ...@@ -195,7 +195,7 @@ endfunction()
function(register_operators) function(register_operators)
set(options "") set(options "")
set(oneValueArgs "") set(oneValueArgs "")
set(multiValueArgs EXCLUDES) set(multiValueArgs EXCLUDES DEPS)
cmake_parse_arguments(register_operators "${options}" "${oneValueArgs}" cmake_parse_arguments(register_operators "${options}" "${oneValueArgs}"
"${multiValueArgs}" ${ARGN}) "${multiValueArgs}" ${ARGN})
...@@ -203,11 +203,16 @@ function(register_operators) ...@@ -203,11 +203,16 @@ function(register_operators)
string(REPLACE "_mkldnn" "" OPS "${OPS}") string(REPLACE "_mkldnn" "" OPS "${OPS}")
string(REPLACE ".cc" "" OPS "${OPS}") string(REPLACE ".cc" "" OPS "${OPS}")
list(REMOVE_DUPLICATES OPS) list(REMOVE_DUPLICATES OPS)
list(LENGTH register_operators_DEPS register_operators_DEPS_len)
foreach(src ${OPS}) foreach(src ${OPS})
list(FIND register_operators_EXCLUDES ${src} _index) list(FIND register_operators_EXCLUDES ${src} _index)
if (${_index} EQUAL -1) if (${_index} EQUAL -1)
op_library(${src}) if (${register_operators_DEPS_len} GREATER 0)
op_library(${src} DEPS ${register_operators_DEPS})
else()
op_library(${src})
endif()
endif() endif()
endforeach() endforeach()
endfunction() endfunction()
...@@ -35,7 +35,7 @@ endif() ...@@ -35,7 +35,7 @@ endif()
register_operators(EXCLUDES warpctc_op) register_operators(EXCLUDES warpctc_op)
# warpctc_cudnn need cudnn 7 above # warpctc_cudnn need cudnn 7 above
if (WITH_GPU) if (WITH_GPU AND NOT WIN32)
if (${CUDNN_MAJOR_VERSION} VERSION_LESS 7) if (${CUDNN_MAJOR_VERSION} VERSION_LESS 7)
op_library(warpctc_op DEPS dynload_warpctc sequence_padding sequence_scale SRCS warpctc_op.cc warpctc_op.cu.cc) op_library(warpctc_op DEPS dynload_warpctc sequence_padding sequence_scale SRCS warpctc_op.cc warpctc_op.cu.cc)
else() else()
......
...@@ -29,11 +29,11 @@ foreach(src ${OPS}) ...@@ -29,11 +29,11 @@ foreach(src ${OPS})
set_source_files_properties(${src} PROPERTIES COMPILE_FLAGS ${DISTRIBUTE_COMPILE_FLAGS}) set_source_files_properties(${src} PROPERTIES COMPILE_FLAGS ${DISTRIBUTE_COMPILE_FLAGS})
endforeach() endforeach()
register_operators(EXCLUDES gen_nccl_id_op) register_operators(EXCLUDES gen_nccl_id_op DEPS ${DISTRIBUTE_DEPS})
if(WITH_GPU AND NOT WIN32) if(WITH_GPU AND NOT WIN32)
set(DISTRIBUTE_DEPS ${DISTRIBUTE_DEPS} nccl_common) set(DISTRIBUTE_DEPS ${DISTRIBUTE_DEPS} nccl_common)
op_library(gen_nccl_id_op) op_library(gen_nccl_id_op ${DISTRIBUTE_DEPS} nccl_common)
endif() endif()
set(OPERATOR_DEPS ${OPERATOR_DEPS} ${DISTRIBUTE_DEPS} PARENT_SCOPE) set(OPERATOR_DEPS ${OPERATOR_DEPS} ${DISTRIBUTE_DEPS} PARENT_SCOPE)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册