[SYCL] Free function host compilation bugfix #19901
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a joined cherry-pick of:
[SYCL] Free function host compilation bugfix (#19541)
The
KernelInfoDatastruct 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:
KernelInfoDatastruct is specialized in the integration header for unnamed kernels such as free function kernels with the primary definition located inkernel_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-lambdadoesn'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
KernelInfoandKernelInfoDataand 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 voodoomagic.