Skip to content

Commit 1669048

Browse files
authored
Make dlpack version easily discoverable (#165)
Create dlpack_version.txt file containing the required dlpack version and update CMakeLists.txt to read from it instead of hardcoding the version. This addresses issue #164 by making the dlpack dependency version easily accessible to users and automated build systems without requiring manual parsing of CMake files. Fixes #164 Signed-off-by: Emilien Macchi <[email protected]>
1 parent e0449f6 commit 1669048

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

dlpack_version.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
1.1

python/CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,14 @@ IF(CUDNN_FRONTEND_USE_SYSTEM_DLPACK)
1717
message(FATAL_ERROR "dlpack not found")
1818
endif()
1919
else()
20+
# Read dlpack version from dlpack_version.txt
21+
file(READ ${PROJECT_SOURCE_DIR}/dlpack_version.txt DLPACK_VERSION)
22+
string(STRIP "${DLPACK_VERSION}" DLPACK_VERSION)
23+
2024
FetchContent_Declare(
2125
dlpack
2226
GIT_REPOSITORY https://github.com/dmlc/dlpack
23-
GIT_TAG v1.1
27+
GIT_TAG v${DLPACK_VERSION}
2428
)
2529
FetchContent_MakeAvailable(dlpack)
2630
endif()

0 commit comments

Comments
 (0)