[Openmp-commits] [PATCH] D142145: [OpenMP][libomptarget] Fix deinit of NextGen AMDGPU plugin

Kevin Sala Penad├ęs via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Thu Jan 19 14:12:22 PST 2023


kevinsala added a comment.

In D142145#4066891 <https://reviews.llvm.org/D142145#4066891>, @jhuber6 wrote:

> In D142145#4066841 <https://reviews.llvm.org/D142145#4066841>, @kevinsala wrote:
>
>> Not sure if you refer to the `Initialized` variable. In this case it's not a global, it's a data member of the `AMDGPUPluginTy` class.
>
> I mean when we link against HSA we have something like `hsa_deinit()` as a function with a valid address. When we load it dynamically it's just forward declared like `HSA_STATUS_T (hsa_deinit())(void);` which is initialized to zero.

I'll update the patch with that change, thanks! We can avoid calling another HSA function and call directly `hsa_shut_down` ignoring the error code, right?

  if (hsa_shut_down)
    hsa_shut_down();


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D142145/new/

https://reviews.llvm.org/D142145



More information about the Openmp-commits mailing list