Commit 9eaa344
[SYCL] Assert for kernel having a name in runtime vs compile time (#20060)
Follow-up for #19990
Downstream CI uncovered another scenario where
`detail::CompileTimeKernelInfo<KernelName>.Name` might be empty (other
than non-SYCL compilation in some of the [unit]tests). That happens when
compiling the same TU using multiple offload models (e.g., both SYCL and
OMP) and the device compilation for non-SYCL model doesn't use SYCL
integration header to provide kernel information.
Ideally, we should be just guarding `static_assert`s with some `#if
__SYCL_WHATEVER` but we don't set any SYCL-related macro when using 3rd
party host compilers. Deal with that by turning compile-time
`static_assert` into a run-time `assert` unless we can guarantee that
SYCL kernel information is available.
---------
Co-authored-by: Sergey Semenov <[email protected]>1 parent cb8b521 commit 9eaa344
File tree
3 files changed
+16
-19
lines changed- sycl
- include/sycl
- test
- unittests
3 files changed
+16
-19
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
836 | 836 | | |
837 | 837 | | |
838 | 838 | | |
839 | | - | |
840 | | - | |
841 | | - | |
842 | | - | |
843 | | - | |
844 | | - | |
845 | | - | |
846 | | - | |
847 | | - | |
848 | | - | |
849 | | - | |
850 | 839 | | |
851 | 840 | | |
852 | | - | |
| 841 | + | |
| 842 | + | |
| 843 | + | |
| 844 | + | |
| 845 | + | |
| 846 | + | |
| 847 | + | |
| 848 | + | |
| 849 | + | |
| 850 | + | |
| 851 | + | |
| 852 | + | |
| 853 | + | |
853 | 854 | | |
854 | 855 | | |
855 | 856 | | |
856 | 857 | | |
857 | 858 | | |
858 | | - | |
| 859 | + | |
| 860 | + | |
859 | 861 | | |
860 | 862 | | |
861 | 863 | | |
| |||
866 | 868 | | |
867 | 869 | | |
868 | 870 | | |
869 | | - | |
870 | 871 | | |
871 | 872 | | |
872 | 873 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
126 | 126 | | |
127 | 127 | | |
128 | 128 | | |
129 | | - | |
130 | | - | |
131 | | - | |
| 129 | + | |
132 | 130 | | |
133 | 131 | | |
134 | 132 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
13 | | - | |
14 | 12 | | |
15 | 13 | | |
16 | 14 | | |
| |||
0 commit comments