Skip to content

Commit

Permalink
Add clang 16/17 CUDA CodeGen fix patch
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-penev authored and vgvassilev committed Sep 18, 2023
1 parent cb12820 commit aa66f9e
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
13 changes: 13 additions & 0 deletions patches/llvm/clang16-4-CUDA-CodeGenFix.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b//clang/lib/CodeGen/CodeGenModule.cpp
index f09d1129b128..82289cba3c12 100644
--- a/clang/lib/CodeGen/CodeGenModule.cpp
+++ b/clang/lib/CodeGen/CodeGenModule.cpp
@@ -786,7 +786,7 @@ void CodeGenModule::Release() {
AddGlobalCtor(ObjCInitFunction);
if (Context.getLangOpts().CUDA && CUDARuntime) {
if (llvm::Function *CudaCtorFunction = CUDARuntime->finalizeModule())
- AddGlobalCtor(CudaCtorFunction);
+ AddGlobalCtor(CudaCtorFunction, 0);
}
if (OpenMPRuntime) {
if (llvm::Function *OpenMPRequiresDirectiveRegFun =
13 changes: 13 additions & 0 deletions patches/llvm/clang17-1-CUDA-CodeGenFix.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b//clang/lib/CodeGen/CodeGenModule.cpp
index f09d1129b128..82289cba3c12 100644
--- a/clang/lib/CodeGen/CodeGenModule.cpp
+++ b/clang/lib/CodeGen/CodeGenModule.cpp
@@ -786,7 +786,7 @@ void CodeGenModule::Release() {
AddGlobalCtor(ObjCInitFunction);
if (Context.getLangOpts().CUDA && CUDARuntime) {
if (llvm::Function *CudaCtorFunction = CUDARuntime->finalizeModule())
- AddGlobalCtor(CudaCtorFunction);
+ AddGlobalCtor(CudaCtorFunction, 0);
}
if (OpenMPRuntime) {
if (llvm::Function *OpenMPRequiresDirectiveRegFun =

0 comments on commit aa66f9e

Please sign in to comment.