<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/85049>85049</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[clang][OpenCL] kernel compiles fail on CL1.2 passes on CL2.0
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
haonanya
</td>
</tr>
</table>
<pre>
kernel:
__kernel void test_bit_reverse(__global TYPE* dst, __global TYPE* base)
{
int index = get_global_id(0);
dst[index] = bit_reverse(base[index]);
}
compile commands for CL1.2 fail:
[haonanya]$ ../ocl-clang/build/bin/clang -cc1 -D TYPE=uchar -cl-std=CL1.2 -D __OPENCL_VERSION__=120 -x cl -emit-llvm-bc -triple spir64-unknown-unknown -include opencl-c.h -cl-ext=+all 12
12:4:18: error: use of undeclared identifier 'bit_reverse'
4 | dst[index] = bit_reverse(base[index]);
| ^
1 error generated.
compile commands for CL2.0, passes:
[haonanya]$ ../ocl-clang/build/bin/clang -cc1 -D TYPE=uchar -cl-std=CL2.0 -D __OPENCL_VERSION__=200 -x cl -emit-llvm-bc -triple spir64-unknown-unknown -include opencl-c.h -cl-ext=+all 12
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy8VEGPqzYQ_jXDZQSCMSzhwCEJiVRp9faprSr1hAyeJO5z7Mg2291_XwHZpquqvVR9XGys-b6Zbz57ZAj6bJlbqHZQdYmc4sX59iKdlfZdJoNT7-039pYNiC3kHeTbvl8P8NVphZFD7Acde8-v7AMDbfr-bNwgDf7869cD0BZViEB7_Nv5IOf4ZqWFerduUNuI2ip-QxAdnjnecb1WQJt8RoiPWMSFvdotAKi6BfO5niXNI-KveKi7dTO6600bxtFdr9KqgCfncf9cZIQnqR_iodp9NGehKjHLgI5uNOlopD0DHYdJGzWv2gIdl1NMx7HAtFuVi24aL9JjOpo0RAWiWxOlHfb9y9fDl_1z_8vhx59-ePnS9yC6gnJM33A0iClfdUyNeb2mw4hp9PpmGMNN-6cynew36363Hyum2o5mUozuxnYuMLvgkpTfIogOaCeNwYJWZQWB2JYgtsUGxBbZe-fnzRQY3Qknq3g00rNCrdhGfdLsEaj-1Ov6YUuJUO_xvxq0EPzJ9OmD6nCvfC0Wz2zZy8gq-1dPKcvn23iTIXB4GPu_2ktZ_o_2Uv497E1UK1QjGplwW9RFLqjYNE1yaZmkkPUTb56qp6qWhSQpFed8KkbZDIIS3VJOZS4KkTdUVk2mmuok6rGuKzoxb0ooc75KbbK58Mz5c6JDmLjdVHnZJEYObMIyYIjuTaR51vh2FTqdA5S50SGGB0PU0SxTaUVUHVS7lxvb_fN8he4D6G5wWJ4oOnt_sKuz6z9leTJ5015ivC1m0xHoeNbxMg3Z6K5AxznnfUlv3v3GYwQ6LhIC0HFR8UcAAAD__xxqkI8">