-
Notifications
You must be signed in to change notification settings - Fork 128
Add flag to strip context #4648
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
Changes from all commits
176a69b
baff256
f9ccda9
a359ba2
4909973
68e13ad
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -181,6 +181,7 @@ struct loader | |
| bool replace_literals = false; | ||
| bool brief = false; | ||
| bool verbose = false; | ||
| bool strip_context = false; | ||
| bool use_debug_symbols = false; | ||
| std::string output_type; | ||
| std::string output; | ||
|
|
@@ -255,6 +256,10 @@ struct loader | |
| ap.help("Replace literals with parameters"), | ||
| ap.set_value(true)); | ||
| ap(passes, {"--apply-pass", "-p"}, ap.help("Passes to apply to model"), ap.append()); | ||
| ap(strip_context, | ||
| {"--strip-context"}, | ||
| ap.help("Strip context from program"), | ||
| ap.set_value(true)); | ||
| ap(output_type, | ||
| {"--graphviz", "-g"}, | ||
| ap.help("Print out a graphviz representation."), | ||
|
|
@@ -470,6 +475,8 @@ struct loader | |
| { | ||
| trim_module(*p.get_main_module(), trim, trim_size); | ||
| } | ||
| if(strip_context) | ||
| p.clear_context(); | ||
|
Comment on lines
+478
to
+479
|
||
| if(replace_literals) | ||
| { | ||
| replace_literals_with_params(p); | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,7 +1,7 @@ | ||||||||||||||||
| /* | ||||||||||||||||
| * The MIT License (MIT) | ||||||||||||||||
| * | ||||||||||||||||
| * Copyright (c) 2015-2025 Advanced Micro Devices, Inc. All rights reserved. | ||||||||||||||||
| * Copyright (c) 2015-2026 Advanced Micro Devices, Inc. All rights reserved. | ||||||||||||||||
| * | ||||||||||||||||
| * Permission is hereby granted, free of charge, to any person obtaining a copy | ||||||||||||||||
| * of this software and associated documentation files (the "Software"), to deal | ||||||||||||||||
|
|
@@ -95,6 +95,8 @@ struct MIGRAPHX_EXPORT program | |||||||||||||||
|
|
||||||||||||||||
| context& get_context() const; | ||||||||||||||||
|
|
||||||||||||||||
|
||||||||||||||||
| /** | |
| * @brief Clears cached compilation state associated with this program. | |
| * | |
| * This resets the program context and also clears any stored targets. | |
| */ |
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -175,6 +175,12 @@ context& program::get_context() const | |||||||||
| return impl->contexts.front(); | ||||||||||
| } | ||||||||||
|
|
||||||||||
| void program::clear_context() | ||||||||||
| { | ||||||||||
|
||||||||||
| { | |
| { | |
| for(auto& m : impl->modules) | |
| mark_instruction_target{0}.apply(m.second); |
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.
The new
--strip-contextflag is user-facing but there’s no corresponding documentation update (driver option docs underdocs/driver/*.rst) and the PR template indicates aCHANGELOG.mdentry is required when the “Added” category is selected. Please add the doc entry for the new flag and a changelog entry describing the new behavior.