CMakeLists.txt 880 字节
Newer Older
C
Chen Weihang 已提交
1 2 3 4 5
# kernel primitive api
add_subdirectory(primitive)
# pten hybird functors and functions called by kernels
add_subdirectory(hybird)

6 7
add_subdirectory(cpu)
if(WITH_GPU OR WITH_ROCM)
8
  add_subdirectory(gpu)
9 10
endif()
if(WITH_MKLDNN)
C
Chen Weihang 已提交
11 12
  # mkldnn will be deprecated and use the new name dnnl
  add_subdirectory(dnnl)
13 14 15 16 17 18 19
endif()
if(WITH_ASCEND_CL)
  add_subdirectory(npu)
endif()
if(WITH_XPU)
  add_subdirectory(xpu)
endif()
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34

set(FLATTEN_DEPS dense_tensor kernel_context kernel_factory utils_cpu unary)
if(WITH_GPU OR WITH_ROCM)
  set(FLATTEN_DEPS ${FLATTEN_DEPS} utils_gpu)
elseif(WITH_XPU)
  set(FLATTEN_DEPS ${FLATTEN_DEPS} utils_xpu)
endif()

if(WITH_GPU)
  nv_library(flatten SRCS flatten_kernel.cc DEPS ${FLATTEN_DEPS})
elseif(WITH_ROCM)
  hip_library(flatten SRCS flatten_kernel.cc DEPS ${FLATTEN_DEPS})
else()
  cc_library(flatten SRCS flatten_kernel.cc DEPS ${FLATTEN_DEPS})
endif()