-
Notifications
You must be signed in to change notification settings - Fork 435
Add native Windows RDNA HIP and CK support #4340
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
Open
Yasei-no-otoko
wants to merge
8
commits into
ROCm:main
Choose a base branch
from
Yasei-no-otoko:agent/windows-rdna-ck-support
base: main
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.
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
02d69c3
Add gfx1151 Windows HIP and CK support
Yasei-no-otoko 710d77f
Extend Windows RDNA CK targets
Yasei-no-otoko 87fc35b
Preserve Linux activation constants
Yasei-no-otoko b0b15a3
Use UCRT math constants on Windows
Yasei-no-otoko bd98889
Merge branch 'main' into agent/windows-rdna-ck-support
Yasei-no-otoko 8072457
Address Copilot review feedback
Yasei-no-otoko 978bb2c
Fix Windows blob generator command quoting
Yasei-no-otoko 71bda0e
Merge branch 'main' into agent/windows-rdna-ck-support
Yasei-no-otoko 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
Some comments aren't visible on the classic Files Changed page.
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
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 |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| # SPDX-License-Identifier: MIT | ||
| # Copyright (C) 2024-2026, Advanced Micro Devices, Inc. All rights reserved. | ||
|
|
||
| import re | ||
| import shlex | ||
| from typing import List | ||
|
|
||
|
|
||
| def windows_blob_gen_argv( | ||
| python_executable: str, blob_gen_cmd: str, blob_dir: str | ||
| ) -> List[str]: | ||
| """Convert a blob generator command to argv without invoking cmd.exe. | ||
|
|
||
| Blob generator commands are stored as shell-like strings whose first | ||
| argument is always a Python script and whose remaining arguments are | ||
| option/value pairs. On Windows, paths in those strings may contain spaces | ||
| (including the checkout, Python installation, output, and tune-file paths). | ||
| Group each option's value before passing the result to CreateProcess so no | ||
| shell quoting is required. | ||
| """ | ||
| command = blob_gen_cmd.format(blob_dir).strip() | ||
| script_match = re.match(r"^(.*?\.py)(?:\s+(.*))?$", command, re.IGNORECASE) | ||
| if script_match is None: | ||
| raise ValueError( | ||
| f"Blob generator command must start with a .py script: {command}" | ||
| ) | ||
|
|
||
| script, raw_args = script_match.groups() | ||
| argv = [python_executable, script] | ||
| if not raw_args: | ||
| return argv | ||
|
|
||
| lexer = shlex.shlex(raw_args, posix=False) | ||
| lexer.whitespace_split = True | ||
| lexer.commenters = "" | ||
|
|
||
| option = None | ||
| values: List[str] = [] | ||
|
|
||
| def append_option(): | ||
| nonlocal option, values | ||
| if option is None: | ||
| return | ||
| argv.append(option) | ||
| if values: | ||
| value = " ".join(values) | ||
| if len(value) >= 2 and value[0] == value[-1] and value[0] in "\"'": | ||
| value = value[1:-1] | ||
| argv.append(value) | ||
| option = None | ||
| values = [] | ||
|
|
||
| for token in lexer: | ||
| is_option = re.match(r"^-{1,2}[A-Za-z]", token) is not None | ||
| if is_option: | ||
| append_option() | ||
| if "=" in token: | ||
| option, first_value = token.split("=", 1) | ||
| values.append(first_value) | ||
| else: | ||
| option = token | ||
| elif option is None: | ||
| raise ValueError(f"Unexpected positional blob generator argument: {token}") | ||
| else: | ||
| values.append(token) | ||
| append_option() | ||
| return argv |
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.