CMakeLists.txt 2.7 KB
Newer Older
1
if(WITH_PSLIB)
T
Thunderbrook 已提交
2 3 4
    if(WITH_PSLIB_BRPC)
        set(BRPC_DEPS pslib_brpc)
    else()
T
Thunderbrook 已提交
5 6 7
        if(NOT WITH_HETERPS)
            set(BRPC_DEPS brpc)
        endif()
T
Thunderbrook 已提交
8
    endif(WITH_PSLIB_BRPC)
9
    cc_library(fleet_wrapper SRCS fleet_wrapper.cc DEPS framework_proto proto_desc op_registry variable_helper scope ${BRPC_DEPS} pslib)
T
Thunderbrook 已提交
10 11 12 13 14
else()
    cc_library(fleet_wrapper SRCS fleet_wrapper.cc DEPS framework_proto variable_helper scope)
endif(WITH_PSLIB)

if(WITH_HETERPS)
F
Fan Zhang 已提交
15
    if(WITH_NCCL AND WITH_GPU)
T
Thunderbrook 已提交
16
        nv_library(ps_gpu_wrapper SRCS ps_gpu_wrapper.cu ps_gpu_wrapper.cc
Y
yaoxuefeng 已提交
17
        DEPS heter_ps gloo_wrapper ${BRPC_DEPS})
T
Thunderbrook 已提交
18
        add_subdirectory(heter_ps)
F
Fan Zhang 已提交
19 20 21 22
    elseif(WITH_XPU_KP)
        xpu_library(ps_gpu_wrapper SRCS ps_gpu_wrapper.kps ps_gpu_wrapper.cc
        DEPS heter_ps gloo_wrapper ${BRPC_DEPS})
        add_subdirectory(heter_ps)
23 24
    elseif(WITH_RCCL)
        hip_library(ps_gpu_wrapper SRCS ps_gpu_wrapper.cu ps_gpu_wrapper.cc
Y
yaoxuefeng 已提交
25
        DEPS heter_ps gloo_wrapper ${BRPC_DEPS})
26
        add_subdirectory(heter_ps)
F
Fan Zhang 已提交
27
    endif()
28
else()
Y
yaoxuefeng 已提交
29
    cc_library(ps_gpu_wrapper SRCS ps_gpu_wrapper.cc DEPS gloo_wrapper)
T
Thunderbrook 已提交
30
endif(WITH_HETERPS)
D
dongdaxiang 已提交
31

32
if(WITH_NCCL OR WITH_RCCL)
33 34
    cc_library(nccl_wrapper SRCS nccl_wrapper.cc DEPS framework_proto variable_helper scope)
endif()
H
hutuxian 已提交
35
if(WITH_BOX_PS)
36 37 38 39 40 41
    if(WITH_GPU)
        nv_library(box_wrapper SRCS box_wrapper.cc box_wrapper.cu DEPS framework_proto lod_tensor box_ps)
    endif()
    if(WITH_ROCM)
        hip_library(box_wrapper SRCS box_wrapper.cc box_wrapper.cu DEPS framework_proto lod_tensor box_ps)
    endif()
H
hutuxian 已提交
42 43 44
else()
    cc_library(box_wrapper SRCS box_wrapper.cc DEPS framework_proto lod_tensor)
endif(WITH_BOX_PS)
45

T
Thunderbrook 已提交
46

47 48
if(WITH_GLOO)
    cc_library(gloo_wrapper SRCS gloo_wrapper.cc DEPS framework_proto variable_helper scope gloo)
49
    cc_library(metrics SRCS metrics.cc DEPS gloo_wrapper)
50 51
else()
    cc_library(gloo_wrapper SRCS gloo_wrapper.cc DEPS framework_proto variable_helper scope)
52
    cc_library(metrics SRCS metrics.cc DEPS gloo_wrapper)
53 54
endif(WITH_GLOO)

T
Thunderbrook 已提交
55 56 57 58 59 60 61 62 63 64 65
if(WITH_PSLIB)
set(DISTRIBUTE_COMPILE_FLAGS "-Wno-non-virtual-dtor -Wno-error=non-virtual-dtor -Wno-error=delete-non-virtual-dtor")
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 7.0)
    set(DISTRIBUTE_COMPILE_FLAGS
            "${DISTRIBUTE_COMPILE_FLAGS} -faligned-new")
endif()
set_source_files_properties(heter_wrapper.cc PROPERTIES COMPILE_FLAGS ${DISTRIBUTE_COMPILE_FLAGS})
endif()

cc_library(heter_wrapper SRCS heter_wrapper.cc DEPS framework_proto
device_context heter_service_proto ${BRPC_DEPS})
T
Thunderbrook 已提交
66

Y
YUNSHEN XIE 已提交
67
cc_test(test_fleet_cc SRCS test_fleet.cc DEPS fleet_wrapper gloo_wrapper fs shell)
68

69
if(WITH_ASCEND OR WITH_ASCEND_CL)
70
    cc_library(ascend_wrapper SRCS ascend_wrapper.cc DEPS framework_proto lod_tensor ascend_ge ascend_graph)
71
endif()