<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/64572>64572</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [libomptarget] miniqmc hangs when running on amdgpu
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          ye-luo
      </td>
    </tr>
</table>

<pre>
    The failure is sporadic. The code seems got stuck in calling hsa_signal_wait_scacquire
I was running on mi250 with SLES SP4 and rocm 5.5.0.

clang version
```
clang++ -v
clang version 18.0.0 (https://github.com/llvm/llvm-project.git c8ed138c34ddb22610f18468c1b7938f9e2abae5)
...
Found HIP installation: /soft/compilers/rocm/rocm-5.5.0, version 5.5.30201
```
reproducer https://github.com/ye-luo/miniqmc
```
cmake -DCMAKE_CXX_COMPILER=clang++ -DQMC_ENABLE_ROCM=ON -DQMC_MIXED_PRECISION=ON -DCMAKE_CXX_FLAGS=--gcc-toolchain=/soft/compilers/gcc/12.2.0/x86_64-suse-linux -DENABLE_OFFLOAD=ON ..
make -j32 miniqmc_sync_move
OMP_NUM_THREADS=16 ./bin/miniqmc_sync_move
```
Note: gcc 12 toolchain is required by gpu runtime libraries from rocm. If your clang is configured with gcc 12 toolchain, there is no need to point to one.

</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUVF1vozgU_TXOyxUIbKDwwEMawk60zcc2s1LfkDEOeMbYGX-0k3-_IiHT3apaaSSEke3Dvefcey61VvSK8xKljyitFtS7QZvywgPp9aLV3aX8OnA4USG94SAs2LM2tBMshOmA6Y6D5Xy00GsH1nn2HYQCRqUUqofB0maKQGXzRoVrLKPshxeGo6hC0XIDb9SC8UpNl7WCUeA0gjfhBjg-rY9wPCRAVQdGsxHSMA2j8Ia8vZmkqodXbqzQaj7Iovl5v4HwI8KPELx-goI4D6MwAoTzwbmzRWSJcI1w3Qs3-DZkekS4lvL1vgRno79x5sJeOGA572KSM5J0XYtxFkenOE-ynMXtQ0HyU8ExbSlPES5uscNwJlBrrzr4sjmAUNZRKambOJAlIFxbfXII10yPZyG5sQjXkwLzElyFQHj1i8O0QSIcxZ9qYPjZ6M4zbuB_KN5qjnA9CiV-jOxzOUf6nUNQrbbLP9fN6uWlWe23h83T-hmR6j9aV39tV816t3x8WjfP-9UWkWq_m7e3m5d11Rye16vNcbPf3Y_ef1o_Lf84IlIFQc9Y4LSWbKBCIVJ9Lk7PGMJ1jEM86VL_zLMmSwLrLQ-kUP4nBNWcyr6un_bL6hbyXosbqW8Ew8y9sRfFmlG_zn263x6a3d_b5uuX5_WymjKLMwgRrluh3hX7iPqg3U47PtW3ZwxiDL9YTa4y_OqKDtoL9Gc_WcKJkYMUraFGcAsno8erDULYnOCivYFbHwsLTKuT6P2Ev1rnY4SpVdzAbwZWGhTnHTgNZy2Umz604rMUi64kXUEKuuBlnBVxFuc4IouhjGgaY0pOD0VKioekaHmKY5pmOM0TShK8ECWOMInyqMBxmiUkjDKenHAex4Qled4ylER8pEKGk4tCbfqFsNbzMkvSB7yQtOXS3ueQKa9Wa31vURJJYZ19hznh5HViSdHq8eyo6blDaXWvHgxU9RbeBq7-PVvo2PVnv_BGlr_ndITra6ZTp12T_ScAAP__Ym6eZQ">