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

    <tr>
        <th>Summary</th>
        <td>
            Half type not declared if opencl-c-base.h and -fdeclare-opencl-builtins is used with clang
        </td>
    </tr>

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

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

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

<pre>
    This is required to get `half` `vstore` and `vload` variants exposed as those do not require `cl_khr_fp16`. I've written a draft patch, but I think this causes multiple other issues:
1. half vectors get defined, which are part of `cl_khr_fp16`
2. math functions, which are part of `cl_khr_fp16` as well.

Any ideas how how we can fix this issue? I'd really like to use `opencl-c-base.h` and `-fdeclare-opencl-builtin` inside mesa as it speeds up compilation of OpenCL C sources a lot, but it makes the `half` OpenCL CTS test fail.

A potential workaround is to define them downstream, but I think this should be fixed in llvm

my patch is here: https://github.com/karolherbst/llvm-project/commit/2b17270e1790e198167fa06f4630e93bde9d519d
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyNVE2PmzAQ_TVwGQWBE0g4cEh3FXWlSj107yuDh-DG2NQfYfPvOyZZNdrdVo2IY2PPzHvzntMacWmeB-mAHou_grQowBs4ooekygeuevqJ07PzxmJccC2WF8pwEddnbiXX3gG-TsZRPHfgB5qBMKCNf0scgzr1chrsSz8VFa0yeErY9owwW-k9auAgLO89TNx3Q8IeoA0eniib1Kc4Ouh4cOhgDMrLSSEYP6Al9C6gS9b7JH9M8n2RQUQOZ-wItFvYCOylRhGTzoPsBuCEaOLWg-k_IrvmYRmM3A_QB915abT7z-jYgRmVyq5pruNeX0AKpK3BzMt3RqKjoZevV24Li2R9WLoiqG1cqQsoecIoCfGOlcyEulOrbtVyh9lwJ8iqF9gpAra6nWmDpC7peERqR7VhRMcjOOnBTYjCQZigM-MkFY8EI5vvFPzwDR7AmWA76jUHZfybGBQ58hNGhfHeIW9Rzz_Ao_PQc_mOPkyGJPaSK5iNPXFrAuEm2sTtKk7MOZJpZu08kR8_NYAbTFACWox9I7NJDUqdx_tS4-VqoJic3EEt3cPg_bQYhB3oOUo_hDYj5rSIUBSdax2xPMRkq8man-QdWtKRUcYJa4st2-ZYbGsa6l1RbXueV_2mWudYr1uBtSiLWqSiWYt6XfPUS6-w-RqN6C8TLlfhphDB7uGdkouMf9NwuaAhXq6ZoAMd0cc0WNX8g9fSlg-EbleFHcqSbct0aNqyrXpR9my3ETvWVazN6YO8rHi36fMuVbxF5Zqk_JIwpnG--ZSxpHxMZcNyxvIy37B1WRZ51rGalaXYlUXBq027TTY5jtEMEUdm7DG1zQKpDUdHm0o67_5scufkUSMu5Sg_D_RXYps7jdKlfLPA_w2NvZHq">