[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 11:48:34 PST 2023


kevinsala added a comment.

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

> In D142145#4066724 <https://reviews.llvm.org/D142145#4066724>, @kevinsala wrote:
>
>> In D142145#4066648 <https://reviews.llvm.org/D142145#4066648>, @jhuber6 wrote:
>>
>>> Another solution might be to call any random HSA function and see if it returns `HSA_STATUS_ERROR_NOT_INITIALIZED`. Not sure if that would save us much.
>>
>> Would that work when dlopening HSA library with `dynamic_hsa` and no library is found?
>
> I figured we'd just return an `HSA_STATUS_ERROR` immediately. But I guess in that case we'd still call the destructor?

In that case, where `hsa_init` returns `HSA_STATUS_ERROR` because there is no HSA library found, the plugin object (`AMDGPUPluginTy`) is kept alive. We set the number of its devices to zero but there are no further initializations. We then have to handle the destructor.


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