-
Notifications
You must be signed in to change notification settings - Fork 165
[tensile][rocblas] build system update #2222
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
Draft
davidd-amd
wants to merge
105
commits into
develop
Choose a base branch
from
users/davidd-amd/tensile-rocblas-cmake-update
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
[tensile][rocblas] build system update #2222
davidd-amd
wants to merge
105
commits into
develop
from
users/davidd-amd/tensile-rocblas-cmake-update
Conversation
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
davidd-amd
commented
Oct 22, 2025
davidd-amd
commented
Oct 22, 2025
davidd-amd
commented
Oct 22, 2025
davidd-amd
commented
Oct 22, 2025
davidd-amd
commented
Oct 22, 2025
davidd-amd
commented
Oct 22, 2025
davidd-amd
commented
Oct 22, 2025
davidd-amd
commented
Oct 22, 2025
davidd-amd
commented
Oct 22, 2025
davidd-amd
commented
Oct 22, 2025
davidd-amd
commented
Oct 22, 2025
davidd-amd
commented
Oct 22, 2025
davidd-amd
commented
Oct 22, 2025
davidd-amd
commented
Oct 22, 2025
davidd-amd
commented
Oct 22, 2025
davidd-amd
commented
Oct 22, 2025
davidd-amd
commented
Oct 22, 2025
davidd-amd
commented
Oct 22, 2025
davidd-amd
commented
Oct 22, 2025
davidd-amd
commented
Oct 22, 2025
davidd-amd
commented
Oct 22, 2025
davidd-amd
commented
Oct 22, 2025
davidd-amd
commented
Oct 22, 2025
davidd-amd
commented
Oct 22, 2025
davidd-amd
commented
Oct 22, 2025
18dd77a to
4d8315d
Compare
9c6da26 to
1a92ca7
Compare
1a92ca7 to
46e8f49
Compare
bstefanuk
reviewed
Nov 20, 2025
Comment on lines
+7
to
+8
| add_library(rocblas-omp-shim INTERFACE) | ||
| add_library(rocblas::omp-shim ALIAS rocblas-omp-shim) |
Contributor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice pattern.
Suggested change
| add_library(rocblas-omp-shim INTERFACE) | |
| add_library(rocblas::omp-shim ALIAS rocblas-omp-shim) | |
| add_library(rocblas-omp-interface INTERFACE) | |
| add_library(rocblas::omp-interface ALIAS rocblas-omp-interface) |
Nit: "shim" feels a bit jargony here, it makes sense because it's a thin adapter layer, but "interface" feels clear and doesn't clash with the similarly named rocblas_shim, which is.. different.
davidd-amd
commented
Nov 22, 2025
41e1651 to
1a47a88
Compare
1a47a88 to
76e0a11
Compare
df4a78e to
1de97b3
Compare
424c8a4 to
9344136
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Motivation
This PR modernizes the rocBLAS and Tensile CMake build systems to adopt current best practices and target-centric design patterns. The legacy build system relied heavily on directory-scoped commands, global state manipulation, and script-based patterns that created build fragility and hindered consumability.
Key Drivers:
find_package()oradd_subdirectory()include_directories,link_directories),CMAKE_*_FLAGSmodifications, and global state manipulationCMakePresets.json, faster onboarding, and simplified CI/CD workflowsEnd State: A target-centric build system where all build properties (compile flags, include directories, link libraries) attach to targets rather than directories, enabling proper usage requirement propagation and eliminating hidden global state.
Technical Details
This refactor encompasses 78 commits transforming the entire CMake infrastructure across rocBLAS and Tensile projects.
Core Modernization Changes
1. Target-Centric Design
include_directories()withtarget_include_directories()link_directories()andlink_libraries()withtarget_link_libraries()add_definitions()withtarget_compile_definitions()target_link_libraries()calls now usePUBLIC/PRIVATE/INTERFACEkeywords for correct usage requirement propagation2. Build System Structure
library/src/blas1/,library/src/blas2/,library/src/blas3/subdirectoriesclients/common/blas1/,clients/common/blas2/, etc. for client utilities3. Configuration Management
CMakePresets.jsonfor both rocBLAS and Tensile:rocblas_shim.cmake- Backward compatibility layer for legacy option names4. Dependency Management
/opt/rocm) in favor offind_package()withCMAKE_PREFIX_PATH5. Symbol Visibility and Library Configuration
6. Simplifies and enables best practices
CMAKE_*_FLAGSmodifications (respects user/developer control)CMAKE_BUILD_TYPEchecks with generator expressions ($<CONFIG:Debug>)file(GLOB)for source files in favor of explicit listingadd_dependencies()callsHIP_PLATFORM) in favor of explicit options7. Language and Compiler Support
enable_language()calls at project level8. Testing and Client Infrastructure
Key File Changes
Root Level:
projects/rocblas/CMakeLists.txt- Complete modernization of project structureprojects/rocblas/CMakePresets.json- New preset-based configuration systemshared/tensile/CMakePresets.json- Tensile preset configurationBuild Configuration:
cmake/build-options.cmake- Centralized option definitionscmake/rocblas_shim.cmake- Backward compatibility layercmake/toolchain-options.cmake- Compiler configurationcmake/rocblas_supported_architectures.cmake- GPU architecture handlingLibrary:
library/CMakeLists.txt- Main library target definitionlibrary/src/CMakeLists.txt- Source organizationlibrary/src/blas{1,2,3}/CMakeLists.txt- BLAS level-specific sourceslibrary/include/CMakeLists.txt- Header managementClients:
clients/CMakeLists.txt- Client infrastructureclients/common/CMakeLists.txt- Shared client utilitiesclients/benchmarks/CMakeLists.txt- Benchmark targetsclients/gtest/CMakeLists.txt- Unit test infrastructureclients/samples/CMakeLists.txt- Sample executablesTest Plan
Validation Approach
1. Build System Validation
develop) and modernized build systems2. Preset System Verification
CMakePresets.json3. Backward Compatibility
rocblas_shim.cmakecorrectly maps legacy options to new options4. Dependency Propagation
5. Cross-Language Support
6. Installation and Packaging
make installcreates proper installation layout*Config.cmakeand*ConfigVersion.cmakefile generationfind_package(rocblas)VALIDATION_EXECUTIVE_SUMMARY.md