CMakeLists.txt 2.7 KB
Newer Older
Z
Zeng Jinle 已提交
1
cc_library(imperative_flag SRCS flags.cc DEPS gflags flags)
Q
QingshuChen 已提交
2
IF(WITH_XPU)
3
cc_library(prepared_operator SRCS prepared_operator.cc DEPS xpu_op_list proto_desc operator device_context lod_tensor selected_rows var_type_traits op_kernel_type data_transform nan_inf_utils pten pten_utils)
Q
QingshuChen 已提交
4
ELSE()
5
cc_library(prepared_operator SRCS prepared_operator.cc DEPS proto_desc operator device_context lod_tensor selected_rows var_type_traits op_kernel_type data_transform nan_inf_utils pten pten_utils)
Q
QingshuChen 已提交
6
ENDIF()
J
Jiabin Yang 已提交
7
cc_library(layer SRCS layer.cc DEPS prepared_operator math_function imperative_flag variable_helper op_registry)
8
add_subdirectory(jit)
9
cc_library(amp SRCS amp_auto_cast.cc DEPS layer )
10
cc_library(tracer SRCS tracer.cc DEPS layer engine program_desc_tracer amp denormal garbage_collector)
11 12
cc_library(basic_engine SRCS basic_engine.cc DEPS layer gradient_accumulator)
cc_library(engine SRCS basic_engine.cc partial_grad_engine.cc DEPS layer gradient_accumulator)
Z
Zeng Jinle 已提交
13
cc_library(imperative_profiler SRCS profiler.cc DEPS flags)
14
if(NOT WIN32)
15
    if(WITH_NCCL OR WITH_RCCL)
16
        cc_library(imperative_all_reduce SRCS all_reduce.cc DEPS collective_helper device_context selected_rows tensor)
17
        cc_library(nccl_context SRCS nccl_context.cc DEPS collective_helper device_context imperative_all_reduce var_type_traits)
18 19 20 21 22 23
        if(WITH_NCCL)
            nv_library(reducer SRCS reducer.cc reducer.cu DEPS layer imperative_all_reduce)
        endif()
        if(WITH_RCCL)
            hip_library(reducer SRCS reducer.cc reducer.cu DEPS layer imperative_all_reduce)
        endif()
24
    endif()
25 26 27 28
    if(WITH_XPU_BKCL)
        cc_library(bkcl_context SRCS bkcl_context.cc DEPS collective_helper device_context tensor var_type_traits)
        cc_library(reducer SRCS reducer.cc DEPS layer)
    endif()
29 30 31 32
    if(WITH_ASCEND_CL)
        cc_library(hccl_context SRCS hccl_context.cc DEPS collective_helper device_context tensor var_type_traits)
        cc_library(reducer SRCS reducer.cc DEPS layer)
    endif()
33
    cc_library(data_loader SRCS data_loader.cc DEPS enforce)
34
endif(NOT WIN32)
35 36
if(WITH_GLOO)
    cc_library(imperative_gloo_context SRCS gloo_context.cc DEPS collective_helper device_context tensor var_type_traits)
37
    if ( WIN32 OR (NOT (WITH_NCCL OR WITH_RCCL OR WITH_XPU_BKCL OR WITH_ASCEND_CL) ))
38 39 40
        cc_library(reducer SRCS reducer.cc DEPS layer)
    endif()
endif()
J
Jiabin Yang 已提交
41

42
if(NOT WITH_ASCEND_CL)
43
cc_library(gradient_accumulator SRCS gradient_accumulator.cc DEPS blas operator lod_tensor selected_rows selected_rows_functor var_type_traits layer math_function)
44 45 46
else()
cc_library(gradient_accumulator SRCS gradient_accumulator.cc DEPS blas operator lod_tensor selected_rows selected_rows_functor var_type_traits layer math_function npu_op_runner)
endif()
47

J
Jiabin Yang 已提交
48
add_subdirectory(tests)