CMakeLists.txt 1.4 KB
Newer Older
Q
Qiao Longfei 已提交
1 2 3 4 5 6 7 8
if(WITH_GPU)
  cc_library(enforce SRCS enforce.cc DEPS nccl)
else()
  cc_library(enforce SRCS enforce.cc)
endif()
cc_test(enforce_test SRCS enforce_test.cc DEPS stringpiece enforce)

cc_library(cpu_info SRCS cpu_info.cc DEPS gflags glog enforce)
L
liaogang 已提交
9
cc_test(cpu_info_test SRCS cpu_info_test.cc DEPS cpu_info)
L
liaogang 已提交
10

Q
Qiao Longfei 已提交
11
nv_library(gpu_info SRCS gpu_info.cc DEPS gflags glog enforce)
12

Q
Qiao Longfei 已提交
13
cc_library(place SRCS place.cc DEPS enforce)
L
liaogang 已提交
14
cc_test(place_test SRCS place_test.cc DEPS place glog gflags)
L
liaogang 已提交
15

L
liaogang 已提交
16
add_subdirectory(dynload)
L
liaogang 已提交
17

Q
qijun 已提交
18 19 20 21 22 23
IF(WITH_GPU)
    set(GPU_CTX_DEPS dynload_cuda dynamic_loader)
ELSE()
    set(GPU_CTX_DEPS)
ENDIF()

T
tensor-tang 已提交
24 25 26 27 28 29
IF(WITH_MKLDNN)
    set(MKLDNN_CTX_DEPS mkldnn)
ELSE()
    set(MKLDNN_CTX_DEPS)
ENDIF()

Q
qijun 已提交
30 31 32
# memcpy deoends on device_context, here add deps individually for
# avoiding cycle dependencies
cc_library(device_context SRCS device_context.cc DEPS memory buddy_allocator
T
tensor-tang 已提交
33
    system_allocator memory_block meta_data meta_cache place eigen3 ${GPU_CTX_DEPS} ${MKLDNN_CTX_DEPS})
D
dzhwinter 已提交
34
nv_test(device_context_test SRCS device_context_test.cu DEPS device_context gpu_info)
35 36

nv_test(cudnn_helper_test SRCS cudnn_helper_test.cc DEPS dynload_cuda)
Y
Yu Yang 已提交
37
nv_test(transform_test SRCS transform_test.cu DEPS paddle_memory place device_context)
Y
Yu Yang 已提交
38
nv_test(nccl_test SRCS nccl_test.cu DEPS dynload_cuda gpu_info device_context)
D
dangqingqing 已提交
39 40 41

cc_library(profiler SRCS profiler.cc DEPS device_context)
cc_test(profiler_test SRCS profiler_test.cc DEPS profiler)