[all-commits] [llvm/llvm-project] dd0b46: [libomptarget][amdgpu] More robust handling of fai...

Jon Chesterfield via All-commits all-commits at lists.llvm.org
Sun Jul 25 15:16:25 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: dd0b463dd9ed4901a2e8fec498931bdf94a3f656
      https://github.com/llvm/llvm-project/commit/dd0b463dd9ed4901a2e8fec498931bdf94a3f656
  Author: Jon Chesterfield <jonathanchesterfield at gmail.com>
  Date:   2021-07-25 (Sun, 25 Jul 2021)

  Changed paths:
    M openmp/libomptarget/plugins/amdgpu/impl/system.cpp
    M openmp/libomptarget/plugins/amdgpu/src/rtl.cpp

  Log Message:
  -----------
  [libomptarget][amdgpu] More robust handling of failure to init HSA

If hsa_init fails, subsequent calls into hsa are not safe. Except for
hsa_init, but we don't retry on failure.

This patch:
- deletes a print that called into hsa to ask why it can't call into hsa
- drops a merge conflict block next to that print
- reliably initializes number of devices to zero
- skips the plugin destructor contents if the constructor failed to init hsa

Tested by making hsa_init return error, and by forcing the dynamic library
use which was then deleted from disk. Before this patch, both segv. After it,
friendly message about offloading being unavailable.

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D106774




More information about the All-commits mailing list