CMakeLists.txt 3.4 KB
Newer Older
1 2 3 4
cc_library(allocator SRCS allocator.cc DEPS place)
cc_library(cpu_allocator SRCS cpu_allocator.cc DEPS allocator)
cc_library(best_fit_allocator SRCS best_fit_allocator.cc DEPS allocator)
cc_library(locked_allocator SRCS locked_allocator.cc DEPS allocator)
S
sneaxiy 已提交
5
cc_library(buffered_allocator SRCS buffered_allocator.cc DEPS allocator)
S
sneaxiy 已提交
6
cc_library(multi_bin_buffered_allocator SRCS multi_bin_buffered_allocator.cc DEPS allocator gflags)
C
chengduo 已提交
7
cc_library(legacy_allocator SRCS legacy_allocator.cc DEPS allocator buddy_allocator profiler)
S
sneaxiy 已提交
8
cc_library(zero_size_allocator SRCS zero_size_allocator.cc DEPS allocator)
9
cc_test(buffered_allocator_test SRCS buffered_allocator_test.cc DEPS best_fit_allocator locked_allocator buffered_allocator cpu_allocator)
S
sneaxiy 已提交
10
cc_test(multi_bin_buffered_allocator_test SRCS multi_bin_buffered_allocator_test.cc DEPS best_fit_allocator locked_allocator multi_bin_buffered_allocator cpu_allocator)
S
sneaxiy 已提交
11

S
sneaxiy 已提交
12 13 14 15 16 17
cc_library(auto_growth_best_fit_allocator SRCS auto_growth_best_fit_allocator.cc DEPS allocator)
cc_test(auto_growth_best_fit_allocator_test SRCS auto_growth_best_fit_allocator_test.cc DEPS cpu_allocator auto_growth_best_fit_allocator)

if (NOT WIN32)
  cc_test(test_multi_bin_buffered_allocator_division_plan SRCS test_multi_bin_buffered_allocator_division_plan.cc DEPS multi_bin_buffered_allocator)
endif()
S
sneaxiy 已提交
18

S
sneaxiy 已提交
19 20 21
if (WITH_GPU)
  nv_library(cuda_allocator SRCS cuda_allocator.cc DEPS allocator cuda_device_guard)
endif()
22

S
sneaxiy 已提交
23 24
cc_library(retry_allocator SRCS retry_allocator.cc DEPS allocator)

25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
if (WITH_GPU)
    nv_test(best_fit_allocator_test
            SRCS best_fit_allocator_test.cc
                 best_fit_allocator_test.cu
            DEPS best_fit_allocator
                 locked_allocator
                 cpu_allocator
                 cuda_allocator
                 device_context
                 memcpy)
else()
    cc_test(best_fit_allocator_test
            SRCS best_fit_allocator_test.cc
            DEPS best_fit_allocator
                 locked_allocator
                 cpu_allocator)
endif()

Y
Yu Yang 已提交
43
nv_library(pinned_allocator SRCS pinned_allocator.cc DEPS allocator)
44
if (WITH_GPU)
S
sneaxiy 已提交
45
    set(AllocatorFacadeDeps gpu_info cuda_allocator pinned_allocator cuda_device_guard)
46 47 48 49
else ()
    set(AllocatorFacadeDeps)
endif()

S
sneaxiy 已提交
50 51
list(APPEND AllocatorFacadeDeps cpu_allocator locked_allocator best_fit_allocator aligned_allocator auto_increment_allocator conditional_allocator retry_allocator buffered_allocator multi_bin_buffered_allocator auto_growth_best_fit_allocator legacy_allocator zero_size_allocator)

52
cc_library(aligned_allocator SRCS aligned_allocator.cc DEPS allocator)
Y
Yu Yang 已提交
53
cc_library(auto_increment_allocator SRCS auto_increment_allocator.cc DEPS allocator)
Y
Yu Yang 已提交
54
cc_library(conditional_allocator SRCS conditional_allocator.cc DEPS allocator)
S
sneaxiy 已提交
55 56
cc_library(allocator_strategy SRCS allocator_strategy.cc DEPS gflags ${AllocatorFacadeDeps})
cc_library(allocator_facade SRCS allocator_facade.cc DEPS allocator_strategy)
Y
Yu Yang 已提交
57 58

nv_test(allocation_and_eigen_test SRCS allocation_and_eigen_test.cu DEPS allocator_facade)
S
sneaxiy 已提交
59

Y
Yu Yang 已提交
60
cc_test(retry_allocator_test SRCS retry_allocator_test.cc DEPS retry_allocator best_fit_allocator locked_allocator cpu_allocator)
S
sneaxiy 已提交
61 62

cc_test(allocator_facade_test SRCS allocator_facade_test.cc DEPS allocator_facade)
S
sneaxiy 已提交
63 64 65 66

cc_test(naive_best_fit_allocator_facade_test SRCS naive_best_fit_allocator_facade_test.cc DEPS allocator_facade)

cc_test(auto_growth_best_fit_allocator_facade_test SRCS auto_growth_best_fit_allocator_facade_test.cc DEPS allocator_facade)