CMakeLists.txt 1.6 KB
Newer Older
1 2
proto_library(profiler_proto SRCS profiler.proto)

Q
Qiao Longfei 已提交
3
if(WITH_GPU)
Y
Yang Yang(Tony) 已提交
4
  cc_library(enforce SRCS enforce.cc DEPS)
Q
Qiao Longfei 已提交
5 6 7 8 9 10
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 已提交
11
cc_test(cpu_info_test SRCS cpu_info_test.cc DEPS cpu_info)
L
liaogang 已提交
12

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

D
dangqingqing 已提交
15
cc_library(place SRCS place.cc DEPS enforce boost)
L
liaogang 已提交
16
cc_test(place_test SRCS place_test.cc DEPS place glog gflags)
L
liaogang 已提交
17

L
liaogang 已提交
18
add_subdirectory(dynload)
L
liaogang 已提交
19

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

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

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

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

42 43
cc_library(device_tracer SRCS device_tracer.cc DEPS profiler_proto ${GPU_CTX_DEPS})
cc_library(profiler SRCS profiler.cc DEPS device_context device_tracer)
D
dangqingqing 已提交
44
cc_test(profiler_test SRCS profiler_test.cc DEPS profiler)
45 46 47

nv_test(float16_gpu_test SRCS float16_test.cu)
cc_test(float16_test SRCS float16_test.cc)