================
@@ -788,8 +788,12 @@ void CGOpenMPRuntimeGPU::emitKernelDeinit(CodeGenFunction 
&CGF,
           ? 0
           : DL.getTypeAllocSize(LLVMReductionsBufferTy).getFixedValue();
   CGBuilderTy &Bld = CGF.Builder;
+  // The teams-reduction buffer is sized at kernel launch by the offload
+  // plugin to match the actual number of teams, so we always pass 0 as the
+  // buffer length (signal for dynamic sizing) regardless of any value
+  // supplied via the deprecated -fopenmp-cuda-teams-reduction-recs-num flag.
   OMPBuilder.createTargetDeinit(Bld, ReductionDataSize,
-                                C.getLangOpts().OpenMPCUDAReductionBufNum);
+                                /*TeamsReductionBufferLength=*/0);
----------------
jdoerfert wrote:

Do we need to pass the value at all? Only reason might be if flang is using a 
non-zero value, right?

https://github.com/llvm/llvm-project/pull/195102
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to