[Openmp-commits] [openmp] [OpenMP] Remove optimization skipping reduction struct initialization (PR #65697)

Hervé Yviquel via Openmp-commits openmp-commits at lists.llvm.org
Fri Sep 8 11:04:18 PDT 2023


================
@@ -2711,7 +2712,10 @@ void *__kmpc_task_reduction_get_th_data(int gtid, void *tskgrp, void *data) {
 // Called from __kmpc_end_taskgroup()
 static void __kmp_task_reduction_fini(kmp_info_t *th, kmp_taskgroup_t *tg) {
   kmp_int32 nth = th->th.th_team_nproc;
-  KMP_DEBUG_ASSERT(nth > 1); // should not be called if nth == 1
+  KMP_DEBUG_ASSERT(
+      nth > 1 ||
+      __kmp_enable_hidden_helper); // should not be called if nth == 1 unless we
+                                   // are ussing hidden helper threads
----------------
hyviquel wrote:

```suggestion
                                   // are using hidden helper threads
```

https://github.com/llvm/llvm-project/pull/65697


More information about the Openmp-commits mailing list