[HIPIFY][merge] merge amd-develop into amd-staging#2483
Merged
emankov merged 5 commits intoamd-stagingfrom Apr 2, 2026
Merged
Conversation
…ntation (#2473) + [IMP] - `cuFile` testing is optional on `Windows`, as `NVIDIA`: + doesn't support `cuFile` on `Windows` + doesn't ship `cuFile` with `CUDA Toolkit` for `Windows` - Whereas, `cuFile` -> `hipFile` hipification is absolutely possible on `Windows` + [Misc] - Populated the documentation TOC with `cuFile`
… - Part 1 - `Data Types` (#2477) + Updated the regenerated `hipify-perl` and `BLAS` `CUDA2HIP` docs accordingly
…g` (#2481) [Synopsis] + The legacy `hipify-perl` AST parsing for host function arguments (e.g., `HIP_SYMBOL` injection) relies on brittle negated character classes `([^,\)]+)`. + This fails silently or corrupts the `AST` when arguments contain nested C++ syntax like templates (`<int, float>`), function calls, or C++11 initializer lists (`{1, 2}`). + The generated parsing logic was duplicated 9 times across different argument-indexing rules, complicating the `hipify-perl` script and violating the `DRY principle`. [Solution] + [Recursive AST Matching] Replaced rigid negated character classes with recursive Perl `regular expressions (?2)` to perfectly capture and balance complete C++ argument lists. + [Robust Tokenization] Implemented a depth-aware character scanner to safely track nested parentheses, brackets, angle brackets, and braces to split arguments correctly without breaking internal C++ commas. + [DRY / Footprint Reduction] Refactored the C++ generator to output a single, centralized Perl closure (`$process_args`), eliminating the 9-fold code duplication and simplifying the generated `hipify-perl`. [Impact] + Prevents silent transformation failures and `AST` corruption when `API-mandated` casts (`HIP_SYMBOL`, `reinterpret_cast`) are injected into complex host function calls. + Centralizes `hipify-perl` argument parsing logic for future maintainability. [Testing] + `perl -c hipify-perl` + Compared old and new `hipify-perl` outputs of all `hipify-clang` unit tests + Verified an improved hipification for the following unit tests: - reinterpret_cast - device_symbols - macro_check - runtime_functions - runtime_functions_11010 - runtime_functions_before_13000 + Verified AST integrity on host functions containing nested templates and uniform initialization braces [ToDo] + Fix hipification in comments + Implement an automated `hipify-perl` test harness based on the existing `hipify-clang` one
… - Part 2 - `Functions` - final (#2482) + Updated the regenerated `hipify-perl` and `BLAS` `CUDA2HIP` docs accordingly
amd-develop into amd-staging
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
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.
No description provided.