Skip to content

Conversation

@jofrn
Copy link
Contributor

@jofrn jofrn commented Jan 26, 2026

Associated JIRA ticket number/Github issue number

Resolves SWDEV-537768.

What type of PR is this? (check all applicable)

  • Refactor
  • Feature
  • Bug Fix
  • Optimization
  • Documentation Update
  • Continuous Integration

What were the changes?

To support SPIRV in hiprtc -offload-arch=amdgcnspirv path.

Why are these changes needed?

Allows for a SPIRV binary (rather than only ELF) to be loaded via hipModuleLoadData by giving it SPIRV -> Relocatable -> Native ELF translation abilities.

Updated CHANGELOG?

  • Yes
  • No, Does not apply to this PR.

Added/Updated documentation?

  • Yes
  • No, Does not apply to this PR.

Additional Checks

  • I have added tests relevant to the introduced functionality, and the unit tests are passing locally.
  • Any dependent changes have been merged.

When using --offload-arch=amdgcnspirv with HIP RTC, the triple was
identified as "amdgcn-amd-amdhsa--amdgcnspirv" instead
of "spirv64-amd-amdhsa--amdgcnspirv".
@jofrn jofrn requested a review from lamb-j January 26, 2026 17:00
jofrn added 2 commits January 26, 2026 12:10
…xecutable

For --offload-arch=amdgcnspirv, modify compileToExecutable to generate a SPIRV wrapped in ELF.

hiprtcCompileProgram with --offload-arch=amdgcnspirv as program flags invokes
compileToExecutable in this way.
…ith SPIRV

Modify IsCodeObjectElf() to accept generic ELF files in addition to AMDGPU ELF files.
…ELF w/ SPIRV to native kernel machine code

To create the actual executable to run as one loads hip module data, it is extracted from the ELF and then
translated from SPIRV to machine code,

hipModuleLoadData with --offload-arch=amdgcnspirv as program flags invokes
Program::linkImpl in this way.
@jofrn jofrn force-pushed the hiprtc-amdgcnspirv.offload branch from 39de52a to a73485f Compare January 26, 2026 17:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants