Skip to content

Commit

Permalink
[mlir][AMDGPU] Set ABI version constant when linking device libs
Browse files Browse the repository at this point in the history
Currently, linking the device libraries requires setting a constant
that indicates the code object ABI version the compilation is
targeting.

This fixes the MLIR linking process by setting this constant to 400,
which is the value corresponding to the current code object ABI
default, version 4.

Reviewed By: Mogball

Differential Revision: https://reviews.llvm.org/D126913
  • Loading branch information
krzysz00 committed Jun 10, 2022
1 parent f62badd commit a2cdb97
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions mlir/lib/Dialect/GPU/Transforms/SerializeToHsaco.cpp
Expand Up @@ -262,6 +262,10 @@ SerializeToHsacoPass::translateToLLVMIR(llvm::LLVMContext &llvmContext) {
.getZExtValue();
uint32_t isaNumber = minor + 1000 * major;
addControlConstant("__oclc_ISA_version", isaNumber, 32);

// This constant must always match the default code object ABI version
// of the AMDGPU backend.
addControlConstant("__oclc_ABI_version", 400, 32);
}

// Determine libraries we need to link - order matters due to dependencies
Expand Down

0 comments on commit a2cdb97

Please sign in to comment.