[Libomptarget] Deinitialize AMDGPU global state more intentionally
authorJoseph Huber <jhuber6@vols.utk.edu>
Tue, 2 Aug 2022 18:52:47 +0000 (14:52 -0400)
committerJoseph Huber <jhuber6@vols.utk.edu>
Tue, 2 Aug 2022 22:24:39 +0000 (18:24 -0400)
commit2b7203a35972e98b8521f92d2791043dc539ae88
tree47d455bd6ef8d205eb09ca30740f4db31ac7c9c3
parent9cf6511bff97007401238f6cff6bf80cb9af04a5
[Libomptarget] Deinitialize AMDGPU global state more intentionally

A previous patch made the destruction of the HSA plugin more
deterministic. However, there were still other global values that are not
handled this way. When attempting to call a destructor kernel, the
device would have already been uninitialized and we could not find the
appropriate kernel to call. This is because they were stored in global
containers that had their destructors called already. Merges this global
state into the rest of the info state by putting those global values
inside of the global pointer already allocated and deallocated by the
constructor and destructor. This should allow the AMDGPU plugin to
correctly identify the destructors if we were to run them.

Reviewed By: JonChesterfield

Differential Revision: https://reviews.llvm.org/D131011
openmp/libomptarget/plugins/amdgpu/src/rtl.cpp