Skip to content

Commit 81a041a

Browse files
authored
V0.7.3 rc (#38)
* v0.7.2 [Enhancement] Fixed issues in the code which caused warnings in MSVC and clang compilers. [Enhancement] Fixed errors in `get_heuristics_list` where for certain heuristics mode in older cuDNN versions, the heuristics list might be incorrect. [Bug fixes] Fixed several test cases failing on unsupported GPUs to exit gracefully. [Samples] Added a sample to showcase fp8 convolution forward in Nvidia Hopper GPUs. The sample also showcases post convolution book-keeping operations such as scaling and absolute maximum reduction. [Samples] Added a sample which converts fp16 tensor to fp8 and performs transpose and absolute maximum reduction. [Samples] Added a sample to demonstrate Max pooling operation including tensor index dump, necessary to speed up the backward pass. [Samples] Added a sample to showcase the backward pooling operation. * v0.7.3 release [Enhancement] Added `CUDNN_FRONTEND_VERSION` macro to track cudnn frontend version. [Enhancement] Added the `inline` keyword to the get_plan functions to enable inclusion in multiple compilation units. [Bug fix] Replace CUDNN with CUDNN_VERSION as the right macro names. Co-authored-by: Anerudhan Gopal <[email protected]>
1 parent d521ef1 commit 81a041a

File tree

1 file changed

+77
-0
lines changed

1 file changed

+77
-0
lines changed

cmake/cuDNN.cmake

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
add_library(CUDNN::cudnn_all INTERFACE IMPORTED)
2+
3+
find_path(
4+
CUDNN_INCLUDE_DIR cudnn.h
5+
HINTS $ENV{CUDNN_PATH} ${CUDNN_PATH} ${CUDAToolkit_INCLUDE_DIRS}
6+
PATH_SUFFIXES include
7+
)
8+
9+
function(find_cudnn_library NAME)
10+
string(TOUPPER ${NAME} UPPERCASE_NAME)
11+
12+
find_library(
13+
${UPPERCASE_NAME}_LIBRARY ${NAME}
14+
HINTS $ENV{CUDNN_PATH} ${CUDNN_PATH} ${CUDAToolkit_LIBRARY_DIR}
15+
PATH_SUFFIXES lib64 lib/x64 lib
16+
)
17+
18+
if(${UPPERCASE_NAME}_LIBRARY)
19+
add_library(CUDNN::${NAME} UNKNOWN IMPORTED)
20+
set_target_properties(
21+
CUDNN::${NAME} PROPERTIES
22+
INTERFACE_INCLUDE_DIRECTORIES ${CUDNN_INCLUDE_DIR}
23+
IMPORTED_LOCATION ${${UPPERCASE_NAME}_LIBRARY}
24+
)
25+
message(STATUS "${NAME} found at ${${UPPERCASE_NAME}_LIBRARY}.")
26+
else()
27+
message(STATUS "${NAME} not found.")
28+
endif()
29+
30+
31+
endfunction()
32+
33+
find_cudnn_library(cudnn)
34+
find_cudnn_library(cudnn_adv_infer)
35+
find_cudnn_library(cudnn_adv_train)
36+
find_cudnn_library(cudnn_cnn_infer)
37+
find_cudnn_library(cudnn_cnn_train)
38+
find_cudnn_library(cudnn_ops_infer)
39+
find_cudnn_library(cudnn_ops_train)
40+
41+
include (FindPackageHandleStandardArgs)
42+
find_package_handle_standard_args(
43+
LIBRARY REQUIRED_VARS
44+
CUDNN_INCLUDE_DIR CUDNN_LIBRARY
45+
)
46+
47+
if(CUDNN_INCLUDE_DIR AND CUDNN_LIBRARY)
48+
49+
message(STATUS "cuDNN: ${CUDNN_LIBRARY}")
50+
message(STATUS "cuDNN: ${CUDNN_INCLUDE_DIR}")
51+
52+
set(CUDNN_FOUND ON CACHE INTERNAL "cuDNN Library Found")
53+
54+
else()
55+
56+
set(CUDNN_FOUND OFF CACHE INTERNAL "cuDNN Library Not Found")
57+
58+
endif()
59+
60+
target_include_directories(
61+
CUDNN::cudnn_all
62+
INTERFACE
63+
$<INSTALL_INTERFACE:include>
64+
$<BUILD_INTERFACE:${CUDNN_INCLUDE_DIR}>
65+
)
66+
67+
target_link_libraries(
68+
CUDNN::cudnn_all
69+
INTERFACE
70+
CUDNN::cudnn_adv_train
71+
CUDNN::cudnn_ops_train
72+
CUDNN::cudnn_cnn_train
73+
CUDNN::cudnn_adv_infer
74+
CUDNN::cudnn_cnn_infer
75+
CUDNN::cudnn_ops_infer
76+
CUDNN::cudnn
77+
)

0 commit comments

Comments
 (0)