Skip to content

Commit

Permalink
Handle AMDGPU flat_work_group_size reverse translation.
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexVlx committed Nov 26, 2024
1 parent 9659454 commit 108a41f
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions lib/SPIRV/SPIRVReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4636,12 +4636,8 @@ bool SPIRVToLLVM::transMetadata() {

// Generate metadata for reqd_work_group_size
if (auto *EM = BF->getExecutionMode(ExecutionModeLocalSize)) {
if (M->getTargetTriple() == "amdgcn-amd-amdhsa")
F->addFnAttr("amdgpu-flat-work-group-size",
"1," + llvm::utostr(EM->getLiterals().front()));
else
F->setMetadata(kSPIR2MD::WGSize,
getMDNodeStringIntVec(Context, EM->getLiterals()));
F->setMetadata(kSPIR2MD::WGSize,
getMDNodeStringIntVec(Context, EM->getLiterals()));
}
// Generate metadata for work_group_size_hint
if (auto *EM = BF->getExecutionMode(ExecutionModeLocalSizeHint)) {
Expand Down Expand Up @@ -4682,8 +4678,12 @@ bool SPIRVToLLVM::transMetadata() {
}
// Generate metadata for max_work_group_size
if (auto *EM = BF->getExecutionMode(ExecutionModeMaxWorkgroupSizeINTEL)) {
F->setMetadata(kSPIR2MD::MaxWGSize,
getMDNodeStringIntVec(Context, EM->getLiterals()));
if (M->getTargetTriple() == "amdgcn-amd-amdhsa")
F->addFnAttr("amdgpu-flat-work-group-size",
"1," + llvm::utostr(EM->getLiterals().front()));
else
F->setMetadata(kSPIR2MD::MaxWGSize,
getMDNodeStringIntVec(Context, EM->getLiterals()));
}
// Generate metadata for no_global_work_offset
if (BF->getExecutionMode(ExecutionModeNoGlobalOffsetINTEL)) {
Expand Down

0 comments on commit 108a41f

Please sign in to comment.