Commit 3803d657 authored by Connor Baker's avatar Connor Baker
Browse files

cudaPackages.cudnn-frontend: 1.9.0 -> 1.16.0

parent 86ce1ad2
Loading
Loading
Loading
Loading
+0 −30
Original line number Diff line number Diff line
From eeef96e91bd3453160315bf4618b7b91ae7240ba Mon Sep 17 00:00:00 2001
From: Connor Baker <ConnorBaker01@gmail.com>
Date: Sat, 18 Jan 2025 20:48:11 +0000
Subject: [PATCH 1/4] cmake: float out common python bindings option

---
 CMakeLists.txt | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9739569..8944621 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -5,12 +5,11 @@ project(cudnn_frontend VERSION 1.9.0)
 option(CUDNN_FRONTEND_SKIP_JSON_LIB "Defines whether FE should not include nlohmann/json.hpp." OFF)
 option(CUDNN_FRONTEND_BUILD_SAMPLES "Defines if samples are built or not." ON)
 option(CUDNN_FRONTEND_BUILD_TESTS "Defines if unittests are built or not." ON)
+option(CUDNN_FRONTEND_BUILD_PYTHON_BINDINGS "Defines if python bindings are built or not." OFF)
 
 if(MSVC OR MSYS OR MINGW)
-    option(CUDNN_FRONTEND_BUILD_PYTHON_BINDINGS "Defines if python bindings are built or not." OFF)
     add_compile_options(/W4 /WX)
 else()
-    option(CUDNN_FRONTEND_BUILD_PYTHON_BINDINGS "Defines if python bindings are built or not." OFF)
     add_compile_options(-Wall -Wextra -Wpedantic -Werror -Wno-error=attributes -Wno-attributes -Wno-error=unused-function -Wno-unused-function)
 endif()
 
-- 
2.47.0
+0 −84
Original line number Diff line number Diff line
From da16ec51ea78f88f333ecf3df2a249fcc65ead24 Mon Sep 17 00:00:00 2001
From: Connor Baker <ConnorBaker01@gmail.com>
Date: Sat, 18 Jan 2025 22:01:03 +0000
Subject: [PATCH 2/4] cmake: add config so headers can be discovered when
 installed

---
 CMakeLists.txt                 | 39 +++++++++++++++++++++++++++++++---
 cudnn_frontend-config.cmake.in |  3 +++
 2 files changed, 39 insertions(+), 3 deletions(-)
 create mode 100644 cudnn_frontend-config.cmake.in

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8944621..9b1bfba 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.17)
+cmake_minimum_required(VERSION 3.23)
 
 project(cudnn_frontend VERSION 1.9.0)
 
@@ -15,6 +15,15 @@ endif()
 
 add_library(cudnn_frontend INTERFACE)
 
+# Add header files to library
+file(GLOB_RECURSE CUDNN_FRONTEND_INCLUDE_FILES "include/*")
+target_sources(
+    cudnn_frontend PUBLIC FILE_SET HEADERS
+    BASE_DIRS "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
+    FILES "${CUDNN_FRONTEND_INCLUDE_FILES}"
+)
+unset(CUDNN_FRONTEND_INCLUDE_FILES)
+
 target_compile_definitions(
     cudnn_frontend INTERFACE
     $<$<BOOL:${CUDNN_FRONTEND_SKIP_JSON_LIB}>:CUDNN_FRONTEND_SKIP_JSON_LIB>
@@ -58,7 +67,31 @@ endif()
 # * CMAKE_INSTALL_INCLUDEDIR
 include(GNUInstallDirs)
 
+# See https://cmake.org/cmake/help/latest/module/CMakePackageConfigHelpers.html#example-generating-package-files
+include(CMakePackageConfigHelpers)
+
+# Install and export the header files
+install(
+    TARGETS cudnn_frontend
+    EXPORT cudnn_frontend_targets FILE_SET HEADERS
+)
+export(
+    EXPORT cudnn_frontend_targets
+    FILE "${CMAKE_CURRENT_BINARY_DIR}/cudnn_frontend/cudnn_frontend-targets.cmake"
+)
+install(
+    EXPORT cudnn_frontend_targets
+    FILE cudnn_frontend-targets.cmake
+    DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/cudnn_frontend"
+)
+
+# Install the CMake configuration file for header discovery
+configure_package_config_file(
+    cudnn_frontend-config.cmake.in
+    "${CMAKE_CURRENT_BINARY_DIR}/cudnn_frontend-config.cmake"
+    INSTALL_DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/cudnn_frontend"
+)
 install(
-    DIRECTORY ${PROJECT_SOURCE_DIR}/include/
-    DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
+    FILES "${CMAKE_CURRENT_BINARY_DIR}/cudnn_frontend-config.cmake"
+    DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/cudnn_frontend"
 )
diff --git a/cudnn_frontend-config.cmake.in b/cudnn_frontend-config.cmake.in
new file mode 100644
index 0000000..8b2d843
--- /dev/null
+++ b/cudnn_frontend-config.cmake.in
@@ -0,0 +1,3 @@
+@PACKAGE_INIT@
+
+include(${CMAKE_CURRENT_LIST_DIR}/cudnn_frontend-targets.cmake)
-- 
2.47.0
+0 −85
Original line number Diff line number Diff line
From 53d5aaaad09b479cd8c0e148c9428baa33204024 Mon Sep 17 00:00:00 2001
From: Connor Baker <ConnorBaker01@gmail.com>
Date: Sat, 18 Jan 2025 22:10:41 +0000
Subject: [PATCH 3/4] cmake: install samples and tests when built

---
 CMakeLists.txt                        | 12 +++++++++++-
 samples/cpp/CMakeLists.txt            |  2 ++
 samples/legacy_samples/CMakeLists.txt |  2 ++
 test/cpp/CMakeLists.txt               |  2 ++
 4 files changed, 17 insertions(+), 1 deletion(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9b1bfba..f6af111 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -70,11 +70,21 @@ include(GNUInstallDirs)
 # See https://cmake.org/cmake/help/latest/module/CMakePackageConfigHelpers.html#example-generating-package-files
 include(CMakePackageConfigHelpers)
 
-# Install and export the header files
+# Install the components
 install(
     TARGETS cudnn_frontend
     EXPORT cudnn_frontend_targets FILE_SET HEADERS
 )
+
+if (CUDNN_FRONTEND_BUILD_SAMPLES)
+    install(TARGETS legacy_samples samples RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
+endif()
+
+if (CUDNN_FRONTEND_BUILD_TESTS)
+    install(TARGETS tests RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
+endif()
+
+# Export the targets
 export(
     EXPORT cudnn_frontend_targets
     FILE "${CMAKE_CURRENT_BINARY_DIR}/cudnn_frontend/cudnn_frontend-targets.cmake"
diff --git a/samples/cpp/CMakeLists.txt b/samples/cpp/CMakeLists.txt
index 9b8a5eb..01b09bb 100644
--- a/samples/cpp/CMakeLists.txt
+++ b/samples/cpp/CMakeLists.txt
@@ -69,8 +69,10 @@ target_link_libraries(
     _cudnn_frontend_pch
     CUDNN::cudnn
 
+    CUDA::cublasLt
     CUDA::cudart
     CUDA::cuda_driver # Needed as calls all CUDA calls will eventually move to driver
+    CUDA::nvrtc
 )
 
 # target cmake properties
diff --git a/samples/legacy_samples/CMakeLists.txt b/samples/legacy_samples/CMakeLists.txt
index 019f17c..3b56329 100644
--- a/samples/legacy_samples/CMakeLists.txt
+++ b/samples/legacy_samples/CMakeLists.txt
@@ -44,7 +44,9 @@ target_link_libraries(
     _cudnn_frontend_pch
     CUDNN::cudnn
 
+    CUDA::cublasLt
     CUDA::cudart
+    CUDA::nvrtc
 )
 
 # target cmake properties
diff --git a/test/cpp/CMakeLists.txt b/test/cpp/CMakeLists.txt
index e244cd0..2750294 100644
--- a/test/cpp/CMakeLists.txt
+++ b/test/cpp/CMakeLists.txt
@@ -55,7 +55,9 @@ target_link_libraries(
 
     CUDNN::cudnn
 
+    CUDA::cublasLt
     CUDA::cudart
+    CUDA::nvrtc
 )
 
 # cuDNN dlopen's its libraries
-- 
2.47.0
+0 −591

File deleted.

Preview size limit exceeded, changes collapsed.

+0 −133
Original line number Diff line number Diff line
cmake_minimum_required(VERSION 3.23)

project(cudnn_frontend VERSION 1.8.0)

option(CUDNN_FRONTEND_SKIP_JSON_LIB "Defines whether FE should not include nlohmann/json.hpp." OFF)
option(CUDNN_FRONTEND_BUILD_SAMPLES "Defines if samples are built or not." ON)
option(CUDNN_FRONTEND_BUILD_TESTS "Defines if unittests are built or not." ON)
option(CUDNN_FRONTEND_BUILD_PYTHON_BINDINGS "Defines if python bindings are built or not." OFF)

if(MSVC OR MSYS OR MINGW)
    add_compile_options(/W4 /WX)
else()
    add_compile_options(-Wall -Wextra -Wpedantic -Werror -Wno-error=attributes -Wno-attributes -Wno-error=unused-function -Wno-unused-function)
endif()

add_library(cudnn_frontend INTERFACE)

# Add header files to library
file(GLOB_RECURSE CUDNN_FRONTEND_INCLUDE_FILES "include/*")
target_sources(
    cudnn_frontend
    PUBLIC
        FILE_SET
            HEADERS
            BASE_DIRS
                "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
            FILES
                "${CUDNN_FRONTEND_INCLUDE_FILES}"
)
unset(CUDNN_FRONTEND_INCLUDE_FILES)

target_compile_definitions(cudnn_frontend INTERFACE $<$<BOOL:${CUDNN_FRONTEND_SKIP_JSON_LIB}>:CUDNN_FRONTEND_SKIP_JSON_LIB>)

target_include_directories(
    cudnn_frontend
    INTERFACE
        "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
        "$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>"
)

# Find the cuda compiler
find_package(CUDAToolkit REQUIRED)

target_include_directories(cudnn_frontend INTERFACE ${CUDAToolkit_INCLUDE_DIRS})

target_compile_features(cudnn_frontend INTERFACE cxx_std_17)

# Make PCH for targets to link against
add_library(_cudnn_frontend_pch INTERFACE)
target_precompile_headers(_cudnn_frontend_pch INTERFACE ${PROJECT_SOURCE_DIR}/include/cudnn_frontend.h)

if (CUDNN_FRONTEND_BUILD_SAMPLES)
    add_subdirectory(samples)
    target_link_libraries(
        samples
        PRIVATE
            CUDA::cublasLt
            CUDA::nvrtc
    )
    target_link_libraries(
        legacy_samples
        PRIVATE
            CUDA::cublasLt
            CUDA::nvrtc
    )
endif()

if (CUDNN_FRONTEND_BUILD_TESTS)
    add_subdirectory(test)
    target_link_libraries(
        tests
        CUDA::cublasLt
        CUDA::nvrtc
    )
endif()

if (CUDNN_FRONTEND_BUILD_PYTHON_BINDINGS)
    add_subdirectory(python)
endif()

# Introduce variables:
# * CMAKE_INSTALL_LIBDIR
# * CMAKE_INSTALL_BINDIR
# * CMAKE_INSTALL_INCLUDEDIR
include(GNUInstallDirs)

# Install and export the header files
install(
    TARGETS
        cudnn_frontend
    EXPORT
        cudnn_frontend_targets
    FILE_SET HEADERS
)

if (CUDNN_FRONTEND_BUILD_SAMPLES)
    install(TARGETS legacy_samples samples RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
endif()

if (CUDNN_FRONTEND_BUILD_TESTS)
    install(TARGETS tests RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
endif()

# See https://cmake.org/cmake/help/latest/module/CMakePackageConfigHelpers.html#example-generating-package-files
include(CMakePackageConfigHelpers)

export(
    EXPORT
        cudnn_frontend_targets
    FILE
        "${CMAKE_CURRENT_BINARY_DIR}/cudnn_frontend/cudnn_frontend-targets.cmake"
)
install(
    EXPORT
        cudnn_frontend_targets
    FILE
        cudnn_frontend-targets.cmake
    DESTINATION
        "${CMAKE_INSTALL_LIBDIR}/cmake/cudnn_frontend"
)

configure_package_config_file(
    cudnn_frontend-config.cmake.in
    "${CMAKE_CURRENT_BINARY_DIR}/cudnn_frontend-config.cmake"
    INSTALL_DESTINATION
        "${CMAKE_INSTALL_LIBDIR}/cmake/cudnn_frontend"
)
install(
    FILES
        "${CMAKE_CURRENT_BINARY_DIR}/cudnn_frontend-config.cmake"
    DESTINATION
        "${CMAKE_INSTALL_LIBDIR}/cmake/cudnn_frontend"
)
Loading