[Openmp-commits] [PATCH] D138495: [openmp][mlir] Lower parallel if to new fork_call_if function.

David Truby via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Mon Nov 28 06:51:00 PST 2022


DavidTruby added inline comments.


================
Comment at: openmp/runtime/src/kmp_csupport.cpp:344
+void __kmpc_fork_call_if(ident_t *loc, kmp_int32 argc, kmpc_micro microtask,
+                         bool cond, void *args) {
+  int gtid = __kmp_entry_gtid();
----------------
kiranchandramohan wrote:
> Would we ever want a variable length parameter option like the `kmpc_fork_call`?
As long as this is used only by the OpenMPIRBuilder this parameter will always be a struct. Possibly there would be some use to changing it to a VA_ARGS function like the others for consistency, but I tend to prefer to avoid them whenever possible :)


================
Comment at: openmp/runtime/src/kmp_csupport.cpp:351
+    __kmpc_serialized_parallel(loc, gtid);
+    microtask(&gtid, &zero, args);
+    __kmpc_end_serialized_parallel(loc, gtid);
----------------
kiranchandramohan wrote:
> Would this launch a separate thread?
No, this will just call the outlined function directly from the main thread (or I guess from whichever thread called `__kmpc_fork_call_if`)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D138495/new/

https://reviews.llvm.org/D138495



More information about the Openmp-commits mailing list