Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions amd/comgr/src/comgr-hotswap-elf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,17 @@ using Phdr = ELF::Elf64_Phdr;
using ELFT = ElfView::ELFT;
using ELFFileT = ElfView::ELFFileT;

// This file depends on the COMPUTE_PGM_RSRC1_GRANULATED_* field layout below.
// Assert it so the dependency is caught at compile time if it ever shifts.
static_assert(
amdhsa::COMPUTE_PGM_RSRC1_GRANULATED_WORKITEM_VGPR_COUNT_SHIFT == 0 &&
amdhsa::COMPUTE_PGM_RSRC1_GRANULATED_WORKITEM_VGPR_COUNT_WIDTH == 6,
"GRANULATED_WORKITEM_VGPR_COUNT layout changed unexpectedly.");
static_assert(
amdhsa::COMPUTE_PGM_RSRC1_GRANULATED_WAVEFRONT_SGPR_COUNT_SHIFT == 6 &&
amdhsa::COMPUTE_PGM_RSRC1_GRANULATED_WAVEFRONT_SGPR_COUNT_WIDTH == 4,
"GRANULATED_WAVEFRONT_SGPR_COUNT layout changed unexpectedly.");

// -- applyByteReplace ---------------------------------------------------------

bool applyByteReplace(const RewriteRule &Rule, uint64_t InstOffset,
Expand Down
Loading