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

    <tr>
        <th>Summary</th>
        <td>
            clang-tidy performance-unnecessary-value-param check erronously applied to CUDA kernels
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            clang-tidy
      </td>
    </tr>

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

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

<pre>
    Clang-tidy recommends via the `performance-unnecessary-value-param` check that value parameters in cuda kernels be converted to const ref. These recommendations result in an illegal memory access as the device attempts to access host memory through a reference.

The fix would be for this check to somehow exclude cuda kernels - functions with declared with `__global__`.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyMksGO4ywQhJ8GX1q2AMd2cvAh_4xy-y-r2XNEoG3YwWBBk5m8_cqZzEZ725PValfxVatUzm4OiCPr_mPda6UK2ZjGH8f_HWmL3leXaG7ji1dhrsmZGyTUcVkwmAxXp4AsAuv5immKaVFBY11CQI05q3Srr8oXrFeV1MJ6DtqifgeyiuC-gfsGCVMGF0AXo-AdU0Cf4YKgY7hiIjRAcRsyQcKpgTeLGZ8kilwMGRLm4mnzUQGc9zgrDwsuMd1A6Y0IVL4DG7w6jaCIcFkpb-6PH2zM9K0hm2KZLajtUUwYNDaMHxk_vlmEyX3CRyzebKBTTEDW5e-AEXJc0MYPwE_ti8G_o9UwlaC_qD8cWTCovUpovibW8_N59vGi_PnMet5UZmzNoT2oCkcxtLJr20HsKzvq_aQFN8PQtXjA_SS06EV36Aa9R-wnXrlRcrkTQnZCSNHtm7btsR24Hnp9MP2AbMdxUc433l-XJqa5cjkXHIUYuh2vvLqgz_d2SKn_tIBJubUljZuqvpQ5sx33LlN--pAjj-NTA__Qkcf9MKUYYsn-BmpdvfsqwMvP1-P3CauS_GiJ1szaI5MnJk-zI1sujY4Lk6eN4vGp1xR_oSYmT_domcnTI911lL8DAAD__7FfCdI">