Skip to content

Commit

Permalink
Add CUDNN_INCLUDE_DIR
Browse files Browse the repository at this point in the history
  • Loading branch information
vurusovs committed Jan 17, 2024
1 parent 2a1d055 commit 252c9a7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
14 changes: 10 additions & 4 deletions modules/nvidia_plugin/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ find_library(CUDNN_PATH
${HAS_REQUIRED}
HINTS "$ENV{CUDNN_PATH}" "${CUDA_TOOLKIT_ROOT_DIR}" "${CUDA_PATH}" "$ENV{CUDA_PATH}"
PATH_SUFFIXES nvidia/current lib64 lib/x64 lib)
get_filename_component(CUDNN_INCLUDE_DIR "${CUDNN_PATH}" DIRECTORY)
get_filename_component(CUDNN_INCLUDE_DIR "${CUDNN_INCLUDE_DIR}/../../include" REALPATH)

if(CUDAToolkit_VERSION_MAJOR LESS_EQUAL 10)
set(CUTENSOR_LIB_DIRS lib/10.2 libcutensor/10.2)
Expand All @@ -118,14 +120,18 @@ endif()
message("-- [nvidia_gpu] CUTENSOR_PATH ${CUTENSOR_PATH}")
message("-- [nvidia_gpu] CUTENSOR_INCLUDE_DIR ${CUTENSOR_INCLUDE_DIR}")
message("-- [nvidia_gpu] CUDNN_PATH ${CUDNN_PATH}")
message("-- [nvidia_gpu] CUDNN_INCLUDE_DIR ${CUDNN_INCLUDE_DIR}")
message("-- [nvidia_gpu] CUBLAS_PATH ${CUBLAS_PATH}")

add_library(CUDA::cudnn SHARED IMPORTED)
set_target_properties(CUDA::cudnn PROPERTIES IMPORTED_LOCATION "${CUDNN_PATH}")
set_target_properties(CUDA::cudnn PROPERTIES IMPORTED_IMPLIB "${CUDNN_PATH}")
set_target_properties(CUDA::cudnn PROPERTIES IMPORTED_LOCATION "${CUDNN_PATH}"
IMPORTED_IMPLIB "${CUDNN_PATH}"
INTERFACE_INCLUDE_DIRECTORIES "${CUDNN_INCLUDE_DIR}")

add_library(CUDA::cutensor SHARED IMPORTED)
set_target_properties(CUDA::cutensor PROPERTIES IMPORTED_LOCATION "${CUTENSOR_PATH}")
set_target_properties(CUDA::cutensor PROPERTIES IMPORTED_IMPLIB "${CUTENSOR_PATH}")
set_target_properties(CUDA::cutensor PROPERTIES IMPORTED_LOCATION "${CUTENSOR_PATH}"
IMPORTED_IMPLIB "${CUTENSOR_PATH}"
INTERFACE_INCLUDE_DIRECTORIES "${CUTENSOR_INCLUDE_DIR}")

if(NOT DEFINED CMAKE_CUDA_ARCHITECTURES)
if(CUDAToolkit_VERSION_MAJOR LESS_EQUAL 10)
Expand Down
1 change: 1 addition & 0 deletions modules/nvidia_plugin/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ target_include_directories(${OBJ_NAME}
)
target_include_directories(${OBJ_NAME}
PUBLIC
"${CUDNN_INCLUDE_DIR}"
"${CUTENSOR_INCLUDE_DIR}"
"${CMAKE_CURRENT_SOURCE_DIR}"
"${OpenVINONVIDIAGpuPlugin_SOURCE_DIR}/include"
Expand Down

0 comments on commit 252c9a7

Please sign in to comment.