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

    <tr>
        <th>Summary</th>
        <td>
            OpenMP mandatory offload not behaving as expected
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

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

    <tr>
      <th>Reporter</th>
      <td>
          markdewing
      </td>
    </tr>
</table>

<pre>
    When code is compiled with '-fopenmp-offload-mandatory' and the offload fails to run, the offload region is silently skipped.  Naively, I would expect it to behave as if `OMP_TARGET_OFFLOAD=mandatory` was also set in the environment.

(The problem showed up when targeting CUDA offload where the default architecture version for the compiler was not compatible with the architecture on the machine.  If `OMP_TARGET_OFFLOAD=mandatory` is set, the code stops with an error as expected.)

Two possible solutions
1. The host fallback code should issue an error and stop the code
2. Use of the '-fopenmp-offload-mandatory' flag should be conveyed to the runtime, and it can behave appropriately.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyNU11vmzAU_TXwchUEJoTywEPWrFOldammVHusDFzAq7GRbcLy73dNPto-bVIUjK99z7nnHCrdnMpfPSqodYMgLD2HUUhsYBauh4Dlq1aPqIZxpdtWat6sBq4a7rQ5URFoDa5HuBSh5UJacBrMpAJ2_6lmsBNaeRBLCMrJE9g3MY7YRAA_uDiiPPk7jzDrSTaAf0asHQjn-1XY8yMCtyBaCDbx_un59bD9-e3r4XX_8PB9v90F6e6d2iaGmc5yaTVYpCZqoYLqKIxWA6FHQbwL4u3ln90dqDwaXUkcwPZ6JgmmEWavjeOmQydUB_cvu-1tHqoZXNo22PJJOuCm7oUj0hMVjmisn7fVZjl0UdYsxJR2ywZ3ghDPYvtDnzroM-mB055CEunxP0f3EqO76r9Ya50e7RmHK0BjiBXxOGtMDgSs-CjIYdYwamsXdlbLydEo9lxLIvBi9do68lvKitdvF5B-MU5YO-EHGMqIh7-RObdhEbxYn45l_59JayXvrgCV76OOeCKTKBv-PuXNiQH9zB6PQlMTgWtqRnJ2NII7ilgUYplsNgVjRRrHYVOmTZEWPHTCSSz3ROHpGW7QN7e9Y0s7n4MPyoWTkWXv3GiDlHL0QL-OVJ6qiPylFymP18eKWPymS_S6SGRpkRVJnoV9mbK2rnnK8nWV59W6xryIm5yv8zhrkixLQskrlLYMsi8BYwrns8q0DrJdKEoWM5YkLE3u1ndJGmVxGxd5XVVx2qyTDQ_WMQ70bUaeR6RNF5pyoVRNnaWiFNbZ9yIn5zuFuMBRfz65Xpty4OatwZkUCBf0cmH_F7J5cwQ">