CMakeLists.txt 2.3 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)
Y
Yu Yang 已提交
5
nv_library(cuda_allocator SRCS cuda_allocator.cc DEPS allocator cuda_device_guard)
6

S
sneaxiy 已提交
7 8
cc_library(retry_allocator SRCS retry_allocator.cc DEPS allocator)

9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
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()


cc_library(naive_managed_allocator SRCS naive_managed_allocator.cc DEPS allocator)
cc_test(naive_managed_allocator_test SRCS naive_managed_allocator_test.cc DEPS naive_managed_allocator)
Y
Yu Yang 已提交
30
nv_library(pinned_allocator SRCS pinned_allocator.cc DEPS allocator)
31
if (WITH_GPU)
Y
Yu Yang 已提交
32
    set(AllocatorFacadeDeps gpu_info cuda_allocator pinned_allocator)
33 34 35 36 37
else ()
    set(AllocatorFacadeDeps)
endif()

cc_library(aligned_allocator SRCS aligned_allocator.cc DEPS allocator)
Y
Yu Yang 已提交
38
cc_library(auto_increment_allocator SRCS auto_increment_allocator.cc DEPS allocator)
Y
Yu Yang 已提交
39
cc_library(zero_size_allocator SRCS zero_size_allocator.cc DEPS allocator)
Y
Yu Yang 已提交
40
cc_library(conditional_allocator SRCS conditional_allocator.cc DEPS allocator)
41 42 43 44 45 46
cc_library(allocator_facade SRCS allocator_facade.cc DEPS
        ${AllocatorFacadeDeps}
        cpu_allocator
        locked_allocator
        best_fit_allocator
        naive_managed_allocator
Y
Yu Yang 已提交
47
        aligned_allocator
Y
Yu Yang 已提交
48
        auto_increment_allocator
Y
Yu Yang 已提交
49
        zero_size_allocator
Y
Yu Yang 已提交
50
        conditional_allocator
S
sneaxiy 已提交
51
        retry_allocator
Y
Yu Yang 已提交
52
        cuda_device_guard)
Y
Yu Yang 已提交
53 54

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

cc_test(retry_allocator_test SRCS retry_allocator_test.cc DEPS retry_allocator naive_managed_allocator best_fit_allocator locked_allocator cpu_allocator)
S
sneaxiy 已提交
57 58

cc_test(allocator_facade_test SRCS allocator_facade_test.cc DEPS allocator_facade)