Refactor to use a device_description instead of using the hipDeviceProps struct - #5102
Open
pfultz2 wants to merge 4 commits into
Open
Refactor to use a device_description instead of using the hipDeviceProps struct#5102pfultz2 wants to merge 4 commits into
pfultz2 wants to merge 4 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors the GPU cross-compilation plumbing to use a dedicated migraphx::gpu::device_description abstraction instead of synthesizing/depending on hipDeviceProp_t, simplifying gpu::context construction and making the “compile-only” device properties easier to extend.
Changes:
- Introduces
device_descriptionwithfrom_device()andnormalize()to represent the minimal device properties needed for compilation. - Updates GPU
context/hip_deviceandgpu::targetto flow cross-compile parameters viadevice_description. - Updates unit tests, build sources, and cross-compilation documentation accordingly.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| test/gpu/jit.cpp | Updates cross-compile tests to construct gpu::context from device_description and validate wavefront normalization. |
| src/targets/gpu/target.cpp | Switches cross-compile target::get_context() to build a context from the stored device_description. |
| src/targets/gpu/include/migraphx/gpu/target.hpp | Replaces individual cross-compile fields with a single device_description while keeping reflected field names stable. |
| src/targets/gpu/include/migraphx/gpu/device_description.hpp | Adds the device_description API used for local-query and cross-compile scenarios. |
| src/targets/gpu/include/migraphx/gpu/context.hpp | Refactors hip_device and context cross-compile construction to use device_description. |
| src/targets/gpu/device_description.cpp | Implements device_description::from_device() and device_description::normalize(). |
| src/targets/gpu/CMakeLists.txt | Replaces cross_compile_device.cpp with device_description.cpp in the GPU target sources. |
| docs/dev/cross_compilation.rst | Updates developer docs to describe the new device_description-based flow. |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Regressions detected 🔴 * No develop baseline was found for this PR's branch point; compared against the latest available develop run instead. |
|
kahmed10
approved these changes
Aug 3, 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.
Motivation
This simplifies the context constructor so that it can be more easily extended in the future.
Technical Details
Changelog Category
Add a
CHANGELOG.mdentry for any option other thanNot ApplicableFollow the LLVM AI Tool Use Policy for contributions using AI.