CMakeLists.txt 1.4 KB
Newer Older
1 2 3 4
include(operators)

set(COLLECTIVE_DEPS "")

5 6 7
set(COLLECTIVE_COMPILE_FLAGS
    "-Wno-non-virtual-dtor -Wno-error=non-virtual-dtor -Wno-error=delete-non-virtual-dtor"
)
8

9 10 11 12
file(
  GLOB OPS
  RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}"
  "*_op.cc")
13 14 15
list(REMOVE_DUPLICATES OPS)

foreach(src ${OPS})
16 17
  set_source_files_properties(${src} PROPERTIES COMPILE_FLAGS
                                                ${COLLECTIVE_COMPILE_FLAGS})
18 19
endforeach()

20
if(WITH_GLOO)
21
  set(COLLECTIVE_DEPS ${COLLECTIVE_DEPS} gloo_wrapper comm_context_manager)
22 23
endif()

24 25 26 27 28 29 30 31 32
register_operators(
  EXCLUDES
  c_gen_bkcl_id_op
  gen_bkcl_id_op
  c_gen_nccl_id_op
  gen_nccl_id_op
  c_gen_cncl_id_op
  DEPS
  ${COLLECTIVE_DEPS})
33

34
if(WITH_NCCL OR WITH_RCCL)
35 36
  set(COLLECTIVE_DEPS ${COLLECTIVE_DEPS} nccl_common collective_helper
                      comm_context_manager nccl_comm_context)
37 38
  op_library(c_gen_nccl_id_op DEPS ${COLLECTIVE_DEPS})
  op_library(gen_nccl_id_op DEPS ${COLLECTIVE_DEPS})
39 40
endif()

41
if(WITH_XPU_BKCL)
42 43 44
  set(COLLECTIVE_DEPS ${COLLECTIVE_DEPS} collective_helper)
  op_library(c_gen_bkcl_id_op DEPS ${COLLECTIVE_DEPS})
  op_library(gen_bkcl_id_op DEPS ${COLLECTIVE_DEPS})
45 46
endif()

47
if(WITH_CNCL)
48 49
  set(COLLECTIVE_DEPS ${COLLECTIVE_DEPS} collective_helper)
  op_library(c_gen_cncl_id_op DEPS ${COLLECTIVE_DEPS})
50 51
endif()

52 53 54 55 56 57
set(OPERATOR_DEPS
    ${OPERATOR_DEPS} ${COLLECTIVE_DEPS}
    PARENT_SCOPE)
set(GLOB_COLLECTIVE_DEPS
    ${COLLECTIVE_DEPS}
    CACHE INTERNAL "collective dependency")