Skip to content

Commit 32c9f70

Browse files
committed
[SYCL] Fix kernel name mangling for CUDA/HIP with Microsoft ABI host
SYCL kernel names are generated during template instantiation using MangleContext, which produces different encodings based on target ABI. When host compilation uses Microsoft ABI and device compilation targets Itanium ABI (CUDA/HIP), this caused runtime kernel lookup failures: No kernel named _ZTSZZ21performIncrementationENK... was found The issue occurred because Sema::PerformPendingInstantiations() used ASTContext::createMangleContext(), which creates an ABI-specific context for the primary target. In cross-ABI scenarios (Microsoft host + Itanium device), this produced inconsistent names between host and device. Solution: - Added createSYCLMangleContext() helper that detects Microsoft-to-Itanium ABI scenarios - When detected, uses createDeviceMangleContext() for host compilation to ensure Itanium mangling on both sides - Applied to both host and device compilation phases via (LangOpts.SYCLIsHost || LangOpts.SYCLIsDevice) guard This ensures identical kernel names across compilations, allowing runtime lookup to succeed. Fixes CMPLRLLVM-69642
1 parent 8c614ad commit 32c9f70

File tree

2 files changed

+340
-360
lines changed

2 files changed

+340
-360
lines changed

0 commit comments

Comments
 (0)