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

    <tr>
        <th>Summary</th>
        <td>
            openmp interop, could expose handle to device plugin library
        </td>
    </tr>

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

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

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

<pre>
    Idea raised in a meeting, spawning an issue here to help keep track of it.

Openmp has an "interop" feature which gives out a handle to the underlying implementation.

I think an interesting option would be to add an llvm extension which yields a pointer to the offloading infrastructure. Something like a struct containing function pointers initialised with the interface to the plugin abstraction layer.

That would let a careful application programmer do whatever interop style things they want, with the quirk that their interop code would work across cuda/hsa/syc etc.

It would also give a convenient interface to test the implementation through.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJxck8GS4yYQhp8GXbrWJSNb4znosJktV20uOSQv0IKWIEagQGOt3j4F9s7GuUgHoP-v_-4fU7KzJxrE-Tdx_tZgZhPi8HvwH4YSU5wsOd2MQe_Dd00IEW0iDdYDwkLE1s9CfkBacfPWz4AebEqZwFAk4ACG3Ao3ohU4orpBmMDyQbTfRPv18f1jJb-sYDCV10JK65liWIWUMBFyjgSbscrAbO-UIGQGBINeu6rAhiB7TdHthcAuq6OFPCPb4F-UvgMb628VsmhQKvwQ1nITtpCdhrHWRK3LLefuC9APJp_qjUqxF0sSIKyhVvnJEKbJBdSVwU8RE8esCv0B_gwLFekZnL0RIDzOQAXPaKtxU_aqYjyrJrDeskVX_d4smypSzyZUn52vLs9lGmMq_tYKDneKL43_ZZCf_Tkq7imMNGUHuK7OKnwIxzBHXBaKoANsBpnuFOE5DUi8F79LF6ko77Ch5zL8T7h_so034CLGhuyvtypoeupvId4AVQwpgcoahbyaVL5pV0CsXgf2kxpdCnX8hT34O3lLnv_nBiV-ePSyAcAmhjybQ6OHTr9379jQcHyTp8u567pjY4ZWSSnfjlr3p_6CapRvfT-NU4vdBUmfZWMH2cpTe5GXY3c-d8fDZUTVX9qx7_F8nE5HcWppQesOZWEOIc5NDcFwbPvuvW8cjuRSzZiUnrZHRISUJXJxKI--jHlO4tQ6mzj9KsOWHQ3hkZDPXHyAqq7QjzUk-k8UNN2t-twJZ8eIcW9ydINhXpPovgp5FfI6WzZ5PKiwCHktYs_flzWGv0mxkNeKmIS8Pnu4D_LfAAAA__9zxXRd">