Commit 451b21b
committed
[SYCL] Fix kernel name mangling for CUDA/HIP offload with shared libraries
SYCL kernel names are generated during template instantiation using
MangleContext. When using SYCL offload to CUDA/HIP, kernel names must
be consistent across compilation units, including shared libraries
compiled separately.
Previous approach only handled cross-ABI scenarios (Microsoft host +
Itanium device). This left same-ABI scenarios (Itanium host + Itanium
device) broken for shared libraries, as each compilation unit would
generate different lambda numbering, resulting in runtime errors:
No kernel named _ZTSZZ21performIncrementationENK... was found
Solution:
For SYCL offload compilation, always use createDeviceMangleContext()
instead of createMangleContext(). Device mangling context uses
DeviceLambdaManglingNumbers which provides globally consistent lambda
numbering across compilation units.
This ensures identical kernel names for:
- Cross-ABI: Microsoft host + Itanium device (Windows + CUDA/HIP)
- Same-ABI: Itanium host + Itanium device (Linux + CUDA/HIP)
- Shared libraries compiled separately (.so/.dll)
Fixes CMPLRLLVM-69642
Fixes CMPLRLLVM-694151 parent 307759c commit 451b21b
File tree
4 files changed
+9
-11
lines changed- clang/lib/Sema
- sycl/test-e2e/IntermediateLib
4 files changed
+9
-11
lines changedBinary file not shown.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7734 | 7734 | | |
7735 | 7735 | | |
7736 | 7736 | | |
7737 | | - | |
7738 | | - | |
7739 | | - | |
7740 | | - | |
| 7737 | + | |
| 7738 | + | |
| 7739 | + | |
| 7740 | + | |
| 7741 | + | |
| 7742 | + | |
| 7743 | + | |
7741 | 7744 | | |
7742 | | - | |
7743 | | - | |
7744 | | - | |
| 7745 | + | |
7745 | 7746 | | |
7746 | 7747 | | |
7747 | 7748 | | |
7748 | | - | |
| 7749 | + | |
7749 | 7750 | | |
7750 | 7751 | | |
7751 | 7752 | | |
| |||
Binary file not shown.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
3 | | - | |
4 | 1 | | |
5 | 2 | | |
6 | 3 | | |
| |||
0 commit comments