-
Notifications
You must be signed in to change notification settings - Fork 1
Switch to cuDSS 0.8 #11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,78 +1,47 @@ | ||
| # Function to add cuDSS library to the project | ||
| # | ||
| # Usage: | ||
| # add_cudss(CUDSS_BUILD_PATH "/path/to/cudss/build") | ||
| # add_cudss() | ||
| # | ||
| # This function will: | ||
| # - Check if a local cuDSS build exists at CUDSS_BUILD_PATH | ||
| # - If found, use the local build (sets CUDSS_NEW_API compile definition) | ||
| # - If not found, download a prebuilt version using FetchContent | ||
| # - Create an imported target 'cudss' that can be linked against | ||
| # | ||
| # Parameters: | ||
| # CUDSS_BUILD_PATH - Path to the cuDSS build directory (optional, defaults to empty) | ||
| # This function downloads a prebuilt cuDSS release using FetchContent and | ||
| # creates an imported target 'cudss' that can be linked against. The cuDSS | ||
| # version and per-platform archive are selected automatically based on the | ||
| # CUDA compiler version and target architecture (x86_64 or aarch64/sbsa). | ||
| function(add_cudss) | ||
| # Parse arguments | ||
| set(options "") | ||
| set(oneValueArgs CUDSS_BUILD_PATH) | ||
| set(multiValueArgs "") | ||
| cmake_parse_arguments(CUDSS "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) | ||
| # cuDSS release version to download. | ||
| set(CUDSS_VERSION "0.8.0.10") | ||
|
|
||
| # Create imported target | ||
| add_library(cudss STATIC IMPORTED) | ||
|
|
||
| # Check if local build path was provided and exists | ||
| set(LOCAL_CUDSS_BUILD OFF) | ||
| if(CUDSS_CUDSS_BUILD_PATH) | ||
| set(CUDSS_LIB_PATH "${CUDSS_CUDSS_BUILD_PATH}/libcudss_static.a") | ||
| set(CUDSS_INCLUDE_PATH "${CUDSS_CUDSS_BUILD_PATH}/include") | ||
|
|
||
| if(EXISTS "${CUDSS_LIB_PATH}" AND EXISTS "${CUDSS_INCLUDE_PATH}") | ||
| set(LOCAL_CUDSS_BUILD ON) | ||
| message(STATUS "Using local cuDSS build from ${CUDSS_CUDSS_BUILD_PATH}") | ||
| set_target_properties(cudss PROPERTIES | ||
| IMPORTED_LOCATION "${CUDSS_LIB_PATH}" | ||
| INTERFACE_INCLUDE_DIRECTORIES "${CUDSS_INCLUDE_PATH}" | ||
| ) | ||
| endif() | ||
| endif() | ||
|
|
||
| # If local build not found, use prebuilt version | ||
| if(NOT LOCAL_CUDSS_BUILD) | ||
| message(STATUS "Using prebuilt cuDSS") | ||
| set(CUDSS_URL_PREFIX "https://developer.download.nvidia.com/compute/cudss/redist/libcudss/") | ||
| message(STATUS "CUDA Compiler Version: ${CMAKE_CUDA_COMPILER_VERSION}") | ||
|
|
||
| if(${CMAKE_CUDA_COMPILER_VERSION} VERSION_GREATER_EQUAL 13.0) | ||
| set(CUDSS_URL_AARCH64 ${CUDSS_URL_PREFIX}linux-aarch64/libcudss-linux-aarch64-0.7.1.4_cuda13-archive.tar.xz) | ||
| set(CUDSS_URL_X86_64 ${CUDSS_URL_PREFIX}linux-x86_64/libcudss-linux-x86_64-0.7.1.4_cuda13-archive.tar.xz) | ||
| message(STATUS "Using CUDA 13.0 or newer") | ||
| else() | ||
| set(CUDSS_URL_AARCH64 ${CUDSS_URL_PREFIX}linux-aarch64/libcudss-linux-aarch64-0.7.1.4_cuda12-archive.tar.xz) | ||
| set(CUDSS_URL_X86_64 ${CUDSS_URL_PREFIX}linux-x86_64/libcudss-linux-x86_64-0.7.1.4_cuda12-archive.tar.xz) | ||
| message(STATUS "Using CUDA 12.0 or older") | ||
| endif() | ||
| message(STATUS "Using prebuilt cuDSS ${CUDSS_VERSION}") | ||
| set(CUDSS_URL_PREFIX "https://developer.download.nvidia.com/compute/cudss/redist/libcudss/") | ||
| message(STATUS "CUDA Compiler Version: ${CMAKE_CUDA_COMPILER_VERSION}") | ||
|
|
||
| if(CMAKE_SYSTEM_PROCESSOR MATCHES "(aarch64)|(AARCH64)") | ||
| set(CUDSS_URL ${CUDSS_URL_AARCH64}) | ||
| else() | ||
| set(CUDSS_URL ${CUDSS_URL_X86_64}) | ||
| endif() | ||
|
|
||
| include(FetchContent) | ||
| FetchContent_Declare( | ||
| cudss | ||
| DOWNLOAD_EXTRACT_TIMESTAMP TRUE | ||
| URL ${CUDSS_URL} | ||
| ) | ||
| FetchContent_Populate(cudss) | ||
| if(${CMAKE_CUDA_COMPILER_VERSION} VERSION_GREATER_EQUAL 13.0) | ||
| set(CUDSS_CUDA_TAG "cuda13") | ||
| message(STATUS "Using CUDA 13.0 or newer") | ||
| else() | ||
| set(CUDSS_CUDA_TAG "cuda12") | ||
| message(STATUS "Using CUDA 12.0 or older") | ||
| endif() | ||
|
|
||
| set_target_properties(cudss PROPERTIES | ||
| IMPORTED_LOCATION "${cudss_SOURCE_DIR}/lib/libcudss_static.a" | ||
| INTERFACE_INCLUDE_DIRECTORIES "${cudss_SOURCE_DIR}/include" | ||
| ) | ||
| if(CMAKE_SYSTEM_PROCESSOR MATCHES "(aarch64)|(AARCH64)") | ||
| set(CUDSS_URL "${CUDSS_URL_PREFIX}linux-sbsa/libcudss-linux-sbsa-${CUDSS_VERSION}_${CUDSS_CUDA_TAG}-archive.tar.xz") | ||
| else() | ||
| set(CUDSS_URL "${CUDSS_URL_PREFIX}linux-x86_64/libcudss-linux-x86_64-${CUDSS_VERSION}_${CUDSS_CUDA_TAG}-archive.tar.xz") | ||
| endif() | ||
|
|
||
| # Set parent scope variable to indicate if local build is used | ||
| set(LOCAL_CUDSS_BUILD ${LOCAL_CUDSS_BUILD} PARENT_SCOPE) | ||
| include(FetchContent) | ||
| FetchContent_Declare( | ||
| cudss | ||
| DOWNLOAD_EXTRACT_TIMESTAMP TRUE | ||
| URL ${CUDSS_URL} | ||
| ) | ||
| FetchContent_Populate(cudss) | ||
|
alexkorovko marked this conversation as resolved.
|
||
|
|
||
| set_target_properties(cudss PROPERTIES | ||
| IMPORTED_LOCATION "${cudss_SOURCE_DIR}/lib/libcudss_static.a" | ||
| INTERFACE_INCLUDE_DIRECTORIES "${cudss_SOURCE_DIR}/include" | ||
| ) | ||
| endfunction() | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.