================
@@ -143,11 +159,16 @@ GenericKernelTy::getKernelLaunchEnvironment(
   LocalKLE.DynCGroupMemFb = DynBlockMemConf.Fallback;
   LocalKLE.ReductionBuffer = nullptr;
 
-  if (KernelEnvironment.Configuration.ReductionDataSize &&
-      KernelEnvironment.Configuration.ReductionBufferLength) {
+  if (NeedsReductionBuffer) {
+    // Size the teams-reduction buffer. ReductionBufferLength is the
+    // statically known upper bound on the number of teams. When it is 0
+    // (i.e. num_teams was not a compile-time constant), we size the buffer
+    // to exactly match the number of teams for this launch (NumBlocks0).
+    uint32_t BufferElements = RedCfg.ReductionBufferLength
+                                  ? RedCfg.ReductionBufferLength
+                                  : NumBlocks0;
----------------
ro-i wrote:

fixed since removed (see above)

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