This is an archive of the discontinued LLVM Phabricator instance.

[OpenMP][AMDGPU] Extract code object version from the ELF
AbandonedPublic

Authored by saiislam on Dec 30 2022, 9:44 AM.

Details

Summary

Added CodeObjectVersion as a new field in KernelArgPool and
modified relevant constructors to populate it.

Diff Detail

Event Timeline

saiislam created this revision.Dec 30 2022, 9:44 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 30 2022, 9:44 AM
saiislam requested review of this revision.Dec 30 2022, 9:44 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 30 2022, 9:44 AM
openmp/libomptarget/plugins/amdgpu/src/rtl.cpp
128

I don't think the memory pool needs to know what format the elf is using

481

This is per code object, how does a global scalar capture that?

1382

This seems likely to be something already available in the elf library

saiislam updated this revision to Diff 486180.Jan 4 2023, 12:17 AM
saiislam marked 2 inline comments as done.

Fixed usage of CodeObjectVersion and ImplicitArgs size in the old plugin.
A separate patch will be required to support cov5 for the next gen plugin.

openmp/libomptarget/plugins/amdgpu/src/rtl.cpp
128

Fixed in the new diff.

kernargSizeIncludingImplicit() needs the CodeObjectVersion because size of ImplicitArgs in cov4 is 56 bytes whereas it is 256 bytes in cov5.

481

As we do not support mixing of code object versions, the value remains the same for all.

This field gets set during call to __tgt_rtl_load_binary_locked() and is later used as DeviceInfo().CodeObjectVersion.

1382

I took the style that two other functions are using for looking up symbols and getting platform flags in this file. *.getHeader() seem to be the simplest way to get the header.

saiislam abandoned this revision.Aug 30 2023, 2:42 AM

Not required after D139730