[flang-commits] [flang] [llvm] [openmp] [OpenMP] [Flang] Add Fortran integer(kind=8) overloads for omp_lib APIs (PR #221451)

Sairudra More via flang-commits flang-commits at lists.llvm.org
Tue Sep 8 07:45:58 PDT 2026


================
@@ -1127,6 +1229,20 @@ KMP_EXPAND_NAME(FTN_GET_PARTITION_PLACE_NUMS)(int *place_nums) {
 #endif
 }
 
+void FTN_STDCALL FTN_GET_PARTITION_PLACE_NUMS_8(kmp_int64 *place_nums) {
+  int n = KMP_EXPAND_NAME(FTN_GET_PARTITION_NUM_PLACES)();
+  int *place_nums32;
+  if (n <= 0)
+    return;
+  place_nums32 = (int *)KMP_INTERNAL_MALLOC(sizeof(int) * n);
+  if (place_nums32 == NULL)
+    return;
+  KMP_EXPAND_NAME(FTN_GET_PARTITION_PLACE_NUMS)(place_nums32);
+  for (int i = 0; i < n; ++i)
----------------
Saieiei wrote:

Could we avoid copying all `n` entries here unless the underlying query is guaranteed to have written all of them?

For a wrapping place partition, `omp_get_partition_num_places()` can report more entries than the existing `omp_get_partition_place_nums()` implementation writes. That mismatch is pre-existing, but this new wrapper then copies the untouched temporary entries into the integer(8) result.


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


More information about the flang-commits mailing list