================
@@ -794,7 +794,7 @@ void CodeGenModule::Release() {
       AddGlobalCtor(ObjCInitFunction);
   if (Context.getLangOpts().CUDA && CUDARuntime) {
     if (llvm::Function *CudaCtorFunction = CUDARuntime->finalizeModule())
-      AddGlobalCtor(CudaCtorFunction);
+      AddGlobalCtor(CudaCtorFunction, /*Priority=*/0);
----------------
vgvassilev wrote:

@Artem-B, I don’t think @argentite is pushing particularly for this solution of 
the problem. It seems we agree that is a problem and the behavior of clang 
diverges from the reference implementation. I believe we should figure out how 
to fix it. 

Rather than changing the priority we can book a slot for the kernel launch 
declaration respecting the init order.

https://github.com/llvm/llvm-project/pull/66658
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to