<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/75292>75292</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[CUDA]attribute inherit in template function specialization
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
yuyuyu-atri
</td>
</tr>
</table>
<pre>
```
template <typename T>
__device__ T f()
{
return 1;
};
template <>
__host__ int f<int>()
{
return 0;
}
```
`nvcc` can compile the code above, but `clang` will report an error `"no function template matches function template specialization"`.
`f()` will have both `__host__` and `__device__` attributes for `int` but only `__host__` for other types in nvcc.
Is it possible to correspond to `nvcc`?
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx8U1tvozwQ_TXDy6iRY27lgYc2fJG-9-5zZMwkeGVsZA-psr9-ZXJpu12tQFzOOfjMnMEqRnNyRC2Ur1B2mVp49KG9LOl4UhxM1vvh0kIlbqfoQLwwTbNVTAj5ji8zOTURvkH-35W-Xg-Hgc5G0-GAb3gE-QyyufH162chYiBegsMt5K936K7sHth362-Go498OKBxjEfId8Zxknx2_qe_-PCqu9vD18ahEu6sNVQCtXKo_TQbS8gjofYDoer9mUDusF8YoRLaKndK6ndjLQaafWBUDikEH5IApHQej4vTbLzDR3eTYj1S_AsTZ9JGWfNLJRykhEpsHtXdc64EXj1HdSbsPY_J7Z5QopUbrtB9SivIHEy_cHK-FpgyrMTaj3f28ucqSeV5pIDpP4hoHKaAbgX9H9Ewzj5G06eYPGofAsXZuyG9fcQJ-T4b2nxo8kZl1G5rIYtSyirPxrbWuhiGfih1rZqtULWqqkbWx7rS5fb4nGemlULmW7nNRS0LmW90X5RlL7ZlXVDfNBUUgiZl7Mba87Tx4ZSZGBdq61I2MrOqJxvXLSClo3dcyZRs2WWhTd889cspQiGsiRw_VmHDdt07ux_dC5TdIz40bqRgOOXxmNxjll9HmC3BtiPzHCF_AbkHuT8ZHpd-o_0Ecp_cbrenOfifpBnkfq0xgtyvPfwOAAD__x-6Jvk">