AIESW-28179 : Introduce new cfg_type param for hw ctx creation#9709
Merged
chvamshi-xilinx merged 3 commits intoXilinx:masterfrom Apr 6, 2026
Merged
AIESW-28179 : Introduce new cfg_type param for hw ctx creation#9709chvamshi-xilinx merged 3 commits intoXilinx:masterfrom
chvamshi-xilinx merged 3 commits intoXilinx:masterfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR extends the XRT hardware-context creation APIs to accept a new string-valued configuration map (cfg_type) alongside the legacy numeric QoS/config map (cfg_param_type), enabling keys like a human-readable context name. It also adds optional naming support when constructing xrt::module from an ELF.
Changes:
- Add
xrt::hw_context::cfg_type(map of string→string) and newhw_contextconstructor overloads accepting it. - Internally store either legacy or experimental config via
std::variant, convertingcfg_typeto legacy numeric config when calling shimcreate_hw_context. - Add
xrt::moduleconstructor overload that accepts a module name and an internal accessor for it.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/runtime_src/core/tools/common/tests/TestGemm.cpp | Disambiguates xrt::hw_context constructor call by explicitly passing cfg_param_type{}. |
| src/runtime_src/core/include/xrt/xrt_hw_context.h | Introduces cfg_type and new public constructor overloads using it. |
| src/runtime_src/core/common/api/xrt_hw_context.cpp | Implements cfg_type handling via std::variant storage, conversion to legacy config, and adds get_cfg_map. |
| src/runtime_src/core/common/api/hw_context_int.h | Adds internal get_cfg_map() accessor and updates get_qos_map() contract to throw when not applicable. |
| src/runtime_src/core/include/xrt/experimental/xrt_module.h | Adds xrt::module(elf, name) constructor overload. |
| src/runtime_src/core/common/api/xrt_module.cpp | Stores optional module name in module_impl and adds internal module_int::get_name(). |
| src/runtime_src/core/common/api/module_int.h | Declares internal get_name(const xrt::module&) helper. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
stsoe
reviewed
Apr 2, 2026
Signed-off-by: rahul <rbramand@amd.com>
Signed-off-by: rahul <rbramand@amd.com>
70b2a81 to
ba9bdcc
Compare
Contributor
|
clang-tidy review says "All clean, LGTM! 👍" |
stsoe
approved these changes
Apr 3, 2026
stsoe
approved these changes
Apr 3, 2026
Let's not check for valid handle at public API level, it is an error if the module is empty. Not sure if we even need the check internally, but if we do, then shouldn't get_name() should also error out?
Contributor
|
clang-tidy review says "All clean, LGTM! 👍" |
chvamshi-xilinx
approved these changes
Apr 6, 2026
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.
Problem solved by the commit
Introduces new cfg_type (std::map <std::string, std::string>) that can be passed to hw ctx which can be used as replacement for older cfg_param_type (std::map<std::string, uint32_t>). This new cfg_type can be passed as arg to constructor of xrt::hw_context, this way we have flexibility to pass configurations to xrt::hw_context like name etc
Also added changes to pass name while creating xrt::module object
The detailed discussion for same is captured in ticket - https://jira.xilinx.com/browse/AIESW-28179
Bug / issue (if any) fixed, which PR introduced the bug, how it was discovered
This is EOU/Enhancement feature
How problem was solved, alternative solutions (if any) and why they were rejected
We dont want to change shim interface at present so using std::variant style for storing both older and newer maps. This avoids unnecessary boiler plate or duplicate code. Also if new map is passed to create hw ctx we convert it to older map before sending it to shim.
Risks (if any) associated the changes in the commit
Low to moderate
What has been tested and how, request additional testing if necessary
Verified build flow
TODO : Need to verify Telluride start column test that uses QoS to specify start_col value.
Documentation impact (if any)
Added doxygen comments where ever needed