<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/78516>78516</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
openmp and libc fail to compile with dynamic hsa
</td>
</tr>
<tr>
<th>Labels</th>
<td>
libc
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
JonChesterfield
</td>
</tr>
</table>
<pre>
Both in tree runtimes use HSA_AMD_AGENT_INFO_TIMESTAMP_FREQUENCY which is a value in an enum, https://github.com/ROCm/ROCR-Runtime/blob/master/src/inc/hsa.h#L463
The in tree dynamic_hsa/hsa.h doesn't define this, so that doesn't compile. Discovered while trying to build libc on a system with an amdgpu and no hsa.h.
We don't have a great story for versioning hsa and generally handling mismatch between header and library. For timestamp frequency, failing to get it is a soft error anyway, so we should probably just add the enum to the in tree hsa.h.
Other interesting option would be to put a `#define LLVM_DYNAMIC_HSA_IN_USE` or similar in the header and branch over the uses of things that aren't defined in that header, which feels like a path to a mess.
Creating a task instead of fixing as I'm not sure what the right fix is here.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx8VE1v4zYT_jX0ZRBDomx5fdDB60TvmyIfbZJtsSeDEkcidylS5Yzi6t8XlL1tigK9iAdSzwefh6OIbO8RK7H9LLa3KzWxCbH6KfijQWKMnUWnV03Qc_U5sAHrgSMixMmzHZBgIoT_vx5Oh8fb0-F_d09vp_un-vn0dv949_p2ePz5VL_c_fLl7un4Fc7GtgYsgYJ35SZMYMoD-mkQ8giGeSRRHISshax7y2Zq1m0YhKxfno_X5eXm5cIsZN240AhZDyoJFbKm2ApZW5--htTaCFk8bMpCZLciO1y-bwb_8qBnrwbbngypH3-ADkheyB2Dxs56BDaWkjoKwEbxhwNtGEbrcA23ltrwjhF1sugQOM7W98ABmsk6Dc42LQQPCmgmxgHOlk2yrgbdjxMor8EHWBSsP6r9DUGHC5tR7wgK-oiKgTjEGboQ4R0j2eATnSG1IPXoMSrnZjDKa5e2BkuD4tZAg3xG9GBQaYzLcWebqOK8hjpEWDJlNYzQRfx9Qt_OyXynrLs66pHB8iVFCh0DxhgS0nxW8_WizghkwuQ0jDE0qnEzfJuIQWkNbHBJPGHxhzD-bf6ZDUawnjEicaIPI9vg4bxAN5ggxolBgSgzIYtrYg8Pvz6ebr8-HR7vj6dUzfun05fXO1FmECKQHaxTceE1-PEimqh8ayAluWxNhAShSw3wPV3SVxE_tkNfYBRfcZL_S8s7REfg7PcU2qjYJLEKBiT6h8ljyjN5U8CKvoP1xKh04u3sH8sGwb2QuwF8YKApIpwTYVIYbW84nUtxGIy4Xumq0Ptir1ZY5btsuy3yIitXppKq3Jetakssdbfr2mKfI3bYySLfo9w2K1vJTG6yPN9Juck35Tr_VDRN3uy3rc6bTO_EJsNBWbd27n1Yh9ivLNGE1e7TNi9XTjXoaBkjUqa-CynTQIlVOn7TTD2JTeYsMf0NwJYdVmFEP4w_utguZUu3dX1fl8dyfaupJqspuuo_hkWCvy43YwzfsOU0FpJYErJe9P4ZAAD__zjCrBA">