CMakeLists.txt 1.1 KB
Newer Older
1
add_subdirectory(detail)
2
add_subdirectory(allocation)
3 4 5 6 7 8 9 10 11

if (WITH_MKLDNN)
    set(MKLDNN_CTX_DEPS mkldnn)
else ()
    set(MKLDNN_CTX_DEPS)
endif()

cc_library(malloc SRCS malloc.cc DEPS
    place enforce allocator_facade profiler ${MKLDNN_CTX_DEPS})
12
cc_library(memcpy SRCS memcpy.cc DEPS place device_context)
13

14
cc_library(memory DEPS malloc memcpy)
15 16 17 18 19

if (WITH_GPU)
    nv_test(malloc_test
            SRCS malloc_test.cu
            DEPS device_context malloc)
20 21
    nv_test(stream_safe_cuda_alloc_test
            SRCS stream_safe_cuda_alloc_test.cu
22
            DEPS malloc cuda_graph_with_memory_pool)
23 24 25
    
    if(WITH_TESTING AND TEST stream_safe_cuda_alloc_test)
        set_tests_properties(stream_safe_cuda_alloc_test PROPERTIES 
26 27 28
                             ENVIRONMENT "FLAGS_use_stream_safe_cuda_allocator=true;
                                          FLAGS_allocator_strategy=auto_growth")
    endif()  
29 30
endif()

31 32 33 34 35 36
if (WITH_ROCM)
    hip_test(malloc_test
            SRCS malloc_test.cu
            DEPS device_context malloc)
endif()

C
chengduoZH 已提交
37
#if (WITH_GPU)
38
#   nv_test(pinned_memory_test SRCS pinned_memory_test.cu  DEPS place memory)
C
chengduoZH 已提交
39
#endif()