CMakeLists.txt 1.2 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()

Q
qijun 已提交
24 25 26 27
# 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
    system_allocator memory_block meta_data meta_cache place eigen3 ${GPU_CTX_DEPS})
L
liaogang 已提交
28
nv_test(device_context_test SRCS device_context_test.cc DEPS device_context gpu_info)
29 30

nv_test(cudnn_helper_test SRCS cudnn_helper_test.cc DEPS dynload_cuda)
Y
Yu Yang 已提交
31
nv_test(transform_test SRCS transform_test.cu DEPS paddle_memory place device_context)
Y
Yu Yang 已提交
32
nv_test(nccl_test SRCS nccl_test.cu DEPS dynload_cuda gpu_info device_context)