You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[SYCL] Fix issue with half and -fsycl-unnamed-lambda
When `-fsycl-unnamed-lambda` is present, mapping from SYCL Kernel
function to a corresponding OpenCL kernel name is done via
`__unique_stable_name` built-in. It is used by device compiler to generate
integration header and it is used by host compiler to find kernels
information in there.
The problem is that we might get different results for the same SYCL
Kernel function when compiling for host and device: the issue appears if
kernel uses `half` data type which is represented as:
- `cl::sycl::detail::half_impl::half` on host
- `_Float16` on device
Actually, similar issue exists even without `-fsycl-unnamed-lambda`, but
for that case we have a work-around in form of
`#define _Float16 cl::sycl::detail::half_impl::half` in
`kernel_desc.hpp` to turn device half representation into a host one.
The same trick doesn't apply here and the problem is fixed by doing the
following:
- for `UniqueStableMangler`, we mangle
`cl::sycl::detail::half_impl::half` in the same way as `_Float16`, i.e.
`FD16_`
- for `UniqueStableMandlger`, `cl::sycl::detail::half_impl::half` is marked as
non-substitutable to avoid other differences in mangled name
Signed-off-by: Alexey Sachkov <[email protected]>
0 commit comments