[Libomptarget] Add checks for AMDGPU TargetID using new image info
authorSaiyedul Islam <Saiyedul.Islam@amd.com>
Fri, 22 Jul 2022 14:43:15 +0000 (09:43 -0500)
committerSaiyedul Islam <Saiyedul.Islam@amd.com>
Mon, 25 Jul 2022 09:44:36 +0000 (04:44 -0500)
commit471f2abc62d96b3ef97e13f4f7be2d386fc9f75f
treec4de05d7eb4778edee3591c5d1a0de7b1cfab08f
parent5f5f71e73768cb185beaccdca463bf772cf8d1b3
[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

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