CMakeLists.txt 1.1 KB
Newer Older
1 2
add_subdirectory(dynload)

W
Wilber 已提交
3
add_subdirectory(cpu)
4

5 6
add_subdirectory(custom)

W
Wilber 已提交
7 8 9 10
if(WITH_GPU OR WITH_ROCM)
  add_subdirectory(gpu)
endif()

W
Wilber 已提交
11 12 13 14
if(WITH_XPU)
  add_subdirectory(xpu)
endif()

15 16 17 18
cc_library(
  phi_context
  SRCS all_context.cc
  DEPS device_context cpu_context)
W
Wilber 已提交
19 20

if(WITH_XPU)
21
  add_dependencies(phi_context xpu_context)
W
Wilber 已提交
22
endif()
W
Wilber 已提交
23 24

if(WITH_GPU)
25
  add_dependencies(phi_context gpu_context)
W
Wilber 已提交
26
endif()
27 28

if(WITH_CUSTOM_DEVICE)
29
  add_dependencies(phi_context custom_context)
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
  cc_library(
    callback_manager
    SRCS callback_manager.cc
    DEPS enforce place)
  cc_library(
    device_guard
    SRCS device_guard.cc
    DEPS enforce place)
  cc_library(
    stream
    SRCS stream.cc
    DEPS callback_manager)
  cc_library(
    event
    SRCS event.cc
    DEPS enforce place)
  cc_library(
    device_base
    SRCS device_base.cc
    DEPS stream event callback_manager device_guard device_context flags)
  cc_library(
    device_manager
    SRCS device_manager.cc
    DEPS custom_device)
  set(GLOB_DEV_LIB
      device_manager custom_device
      CACHE INTERNAL "Global DEV library")
57
endif()