Skip to content

Conversation

@AlexeySachkov
Copy link
Contributor

@AlexeySachkov AlexeySachkov commented Aug 27, 2025

This is a joined cherry-pick of:


[SYCL] Free function host compilation bugfix (#19541)

The KernelInfoData struct is specialized in the integration header for free function kernels and results in compilation errors when using other host compilers to compile code for example while using -fsycl-host-compiler=g++ . This PR removes its generation for free function kernels in the integration header altogether since it is not used anywhere.

For more info about the bug tackled by this PR:

KernelInfoData struct is specialized in the integration header for unnamed kernels such as free function kernels with the primary definition located in kernel_desc.hpp. The primary definition however seems to be conditional upon the fact that the unnamed lambda extension must be enabled which is not the case with other host compilers and we end up with an error of specialization without a primary template. Furthermore setting -fsycl-unnamed-lambda doesn't do the trick as apparently it is not allowed to be used together with -fsycl-host-compiler. Since it seems unreasonable to disallow using other host compilers with free function kernels, this seemed one of the easier solutions at the moment.

Another approach would be to potentially remove the ifdefs in kernel_desc.hpp that conditionally include/exclude KernelInfo and KernelInfoData and have them both available unconditionally. Tagging @bader for some input about this alternative approach.


[SYCL][TEST] Skip free_function_host_compiler.cpp when using libcxx (#19696)

GNU g++ host compiler doesn't work with libcxx without some voodoo
magic.

The `KernelInfoData` struct is specialized in the integration header for
free function kernels and results in compilation errors when using other
host compilers to compile code for example while using
`-fsycl-host-compiler=g++` . This PR removes its generation for free
function kernels in the integration header altogether since it is not
used anywhere.

For more info about the bug tackled by this PR: 

`KernelInfoData` struct is specialized in the integration header for
unnamed kernels such as free function kernels with the primary
definition located in `kernel_desc.hpp`. The primary definition however
seems to be conditional upon the fact that the unnamed lambda extension
must be enabled which is not the case with other host compilers and we
end up with an error of specialization without a primary template.
Furthermore setting `-fsycl-unnamed-lambda` doesn't do the trick as
apparently it is not allowed to be used together with
`-fsycl-host-compiler`. Since it seems unreasonable to disallow using
other host compilers with free function kernels, this seemed one of the
easier solutions at the moment.

Another approach would be to potentially remove the ifdefs in
kernel_desc.hpp that conditionally include/exclude `KernelInfo `and
`KernelInfoData` and have them both available unconditionally. Tagging
@bader for some input about this alternative approach.

---------

Co-authored-by: Tom Honermann <tom@honermann.net>
…x` (intel#19696)

GNU `g++` host compiler doesn't work with libcxx without some voodoo
magic.
@AlexeySachkov AlexeySachkov merged commit 48609f5 into intel:sycl-rel-6_3 Aug 28, 2025
23 checks passed
@AlexeySachkov AlexeySachkov deleted the private/asachkov/cherry-pick-19541 branch August 28, 2025 14:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants