[Libomptarget] Add checks for AMDGPU TargetID using new image info
authorSaiyedul Islam <Saiyedul.Islam@amd.com>
Mon, 25 Jul 2022 16:40:06 +0000 (11:40 -0500)
committerSaiyedul Islam <Saiyedul.Islam@amd.com>
Tue, 26 Jul 2022 07:44:31 +0000 (02:44 -0500)
commit4075a811ad99b7e263b8b99954cef8c96b042e22
tree47e53b5d27de227fb61e16ba66dbe68b8a8d56a2
parent996b092c5e170786572e925345e502e5376feaee
[Libomptarget] Add checks for AMDGPU TargetID using new image info

This patch extends the is_valid_binary routine to also check if the
binary's target ID matches the one parsed from the system's runtime
environment.
This should allow us to only use the binary whose compute capability
matches, allowing us to support basic multi-architecture binaries for
AMDGPU.
It also handles compatibility testing of target IDs of the image and
the enviornment.

Depends on D127432

Reviewed By: JonChesterfield

Differential Revision: https://reviews.llvm.org/D127769
openmp/libomptarget/plugins/amdgpu/dynamic_hsa/hsa.h
openmp/libomptarget/plugins/amdgpu/src/rtl.cpp