Skip to content

Commit b09953a

Browse files
committed
[Libomptarget] Fix AMDGPU Note handling after D150022
Summary: The changes in https://reviews.llvm.org/D150022 changed the API for this function that we query. Simply pass in the alignment from the associated header to fix.
1 parent d878603 commit b09953a

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

openmp/libomptarget/plugins-nextgen/amdgpu/utils/UtilitiesRTL.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,13 +160,13 @@ class KernelInfoReader {
160160

161161
/// Process ELF note to read AMDGPU metadata from respective information
162162
/// fields.
163-
Error processNote(const object::ELF64LE::Note &Note) {
163+
Error processNote(const object::ELF64LE::Note &Note, size_t Align) {
164164
if (Note.getName() != "AMDGPU")
165165
return Error::success(); // We are not interested in other things
166166

167167
assert(Note.getType() == ELF::NT_AMDGPU_METADATA &&
168168
"Parse AMDGPU MetaData");
169-
auto Desc = Note.getDesc();
169+
auto Desc = Note.getDesc(Align);
170170
StringRef MsgPackString =
171171
StringRef(reinterpret_cast<const char *>(Desc.data()), Desc.size());
172172
msgpack::Document MsgPackDoc;
@@ -313,7 +313,7 @@ Error readAMDGPUMetaDataFromImage(MemoryBufferRef MemBuffer,
313313
if (Err)
314314
return Err;
315315
// Fills the KernelInfoTabel entries in the reader
316-
if ((Err = Reader.processNote(N)))
316+
if ((Err = Reader.processNote(N, S.sh_addralign)))
317317
return Err;
318318
}
319319
}

openmp/libomptarget/plugins/amdgpu/impl/system.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ findMetadata(const ELFObjectFile<ELF64LE> &ELFObj) {
197197
if (Note.getType() == NT_AMDGPU_METADATA && Note.getName() != "AMDGPU")
198198
return Failure;
199199

200-
ArrayRef<uint8_t> Desc = Note.getDesc();
200+
ArrayRef<uint8_t> Desc = Note.getDesc(Phdr.p_align);
201201
return {Desc.data(), Desc.data() + Desc.size()};
202202
}
203203

0 commit comments

Comments
 (0)