[clang] [clang][SYCL Upstreaming] Add sycl_external attribute and restrict emitting device code (PR #140282)
via cfe-commits
cfe-commits at lists.llvm.org
Tue Jun 10 14:15:14 PDT 2025
================
@@ -25,20 +40,29 @@ int main() {
auto lambda2 = [](int){};
auto lambda3 = [](double){};
- kernel<class K1>(lambda1);
- kernel2<class K2>(lambda2);
- kernel3<class K3>(lambda3);
+ kernel_wrapper(lambda1);
+ kernel2_wrapper(lambda2);
+ kernel3_wrapper(lambda3);
// Ensure the kernels are named the same between the device and host
// invocations.
+ kernel_wrapper([](){
(void)__builtin_sycl_unique_stable_name(decltype(lambda1));
(void)__builtin_sycl_unique_stable_name(decltype(lambda2));
(void)__builtin_sycl_unique_stable_name(decltype(lambda3));
+ });
// Make sure the following 3 are the same between the host and device compile.
// Note that these are NOT the same value as each other, they differ by the
// signature.
// CHECK: private unnamed_addr [[$ADDRSPACE]]constant [17 x i8] c"_ZTSZ4mainEUlvE_\00"
// CHECK: private unnamed_addr [[$ADDRSPACE]]constant [17 x i8] c"_ZTSZ4mainEUliE_\00"
// CHECK: private unnamed_addr [[$ADDRSPACE]]constant [17 x i8] c"_ZTSZ4mainEUldE_\00"
+
+ // On Windows, ensure that we haven't broken the 'lambda numbering' for thex
----------------
schittir wrote:
Thank you for the review, @Fznamznon!
https://github.com/llvm/llvm-project/pull/140282
More information about the cfe-commits
mailing list