CMakeLists.txt 1.7 KB
Newer Older
1 2 3
cc_library(
  dynamic_loader
  SRCS dynamic_loader.cc
4
  DEPS glog enforce phi)
5

6 7 8 9 10 11 12 13 14 15 16
list(
  APPEND
  CUDA_SRCS
  cublas.cc
  cublasLt.cc
  cudnn.cc
  curand.cc
  cusolver.cc
  cusparse.cc
  nvtx.cc
  cufft.cc)
17

18 19
if(NOT WITH_NV_JETSON)
  list(APPEND CUDA_SRCS nvjpeg.cc)
20
endif()
21

22
if(WITH_ROCM)
23
  list(APPEND HIP_SRCS rocblas.cc miopen.cc hiprand.cc hipfft.cc)
Y
Y_Xuan 已提交
24
endif()
Y
Yi Wang 已提交
25 26

# There is no macOS version of NCCL.
27
# Disable nvrtc and cuda_driver api on MacOS, and only do a early test on Linux and Windows.
28 29 30
if(NOT APPLE)
  list(APPEND CUDA_SRCS nvrtc.cc cuda_driver.cc)
  if(WITH_NCCL)
31 32
    list(APPEND CUDA_SRCS nccl.cc)
  endif()
33
  if(WITH_ROCM)
Y
Y_Xuan 已提交
34
    list(APPEND HIP_SRCS hiprtc.cc rocm_driver.cc)
35
    if(WITH_RCCL)
Y
Y_Xuan 已提交
36 37
      list(APPEND HIP_SRCS rccl.cc)
    endif()
38 39 40
    if(CUPTI_FOUND)
      list(APPEND HIP_SRCS cupti.cc)
    endif()
Y
Y_Xuan 已提交
41
  endif()
Y
Yi Wang 已提交
42 43
endif()

44
if(TENSORRT_FOUND)
Y
Yan Chunwei 已提交
45 46 47
  list(APPEND CUDA_SRCS tensorrt.cc)
endif()

48 49 50 51
if(CUSPARSELT_FOUND)
  list(APPEND CUDA_SRCS cusparseLt.cc)
endif()

52
configure_file(cupti_lib_path.h.in ${CMAKE_CURRENT_BINARY_DIR}/cupti_lib_path.h)
53 54
if(CUPTI_FOUND)
  list(APPEND CUDA_SRCS cupti.cc)
55
endif()
56
if(WITH_ROCM)
57 58 59
  hip_library(
    dynload_cuda
    SRCS ${HIP_SRCS}
60
    DEPS dynamic_loader phi)
61 62 63
  cc_library(
    dynload_warpctc
    SRCS warpctc.cc
64
    DEPS dynamic_loader warpctc phi)
Y
Y_Xuan 已提交
65
else()
66 67 68
  nv_library(
    dynload_cuda
    SRCS ${CUDA_SRCS}
69
    DEPS dynamic_loader phi)
70 71 72
  cc_library(
    dynload_warpctc
    SRCS warpctc.cc
73
    DEPS dynamic_loader warpctc phi)
74
endif()
75

76
# TODO(TJ): add iomp, mkldnn?
77

78
if(MKL_FOUND AND WITH_ONEMKL)
79
  message("ONEMKL INCLUDE directory is ${MKL_INCLUDE}")
80 81 82
  cc_library(
    dynload_mklrt
    SRCS mklrt.cc
83
    DEPS dynamic_loader phi)
84 85
  target_include_directories(dynload_mklrt PRIVATE ${MKL_INCLUDE})
endif()