tblah wrote:

>     * I imagine that using a C `omp for` inside of a fortran `omp parallel` 
> should work **so long as they use the same openmp library**. Of course care 
> will need to be taken about privatisation etc but that can probably be 
> handled in the interface of the runtime function.

It might not be practical though. An `omp for` inside of an `omp parallel` 
looks a bit like

```
static GlobalOpenMPData data;

void per_thread_callback([...]) {
  int lowerbound, upperbound, stride;
  __kmpc_for_static_int_4u(&data, [...], &lowerbound, &upperbound, &stride, 
[...]);
  for (int i = lowerbound; i < upperbound; i += stride) {
  }
  __kmpc_for_static_fini(&data, [...[);
}

void sourceFunc() {
  __kpmc_fork_call(&data, [...], per_thread_callback, [...]);
}
```

So I guess we would have to pass the OpenMP struct to the runtime function and 
then do all openmp runtime calls manually inside of the runtime library - not 
ideal. Even this would be hard to do because the OpenMP struct is only added to 
the module when we convert to LLVMIR so refering to it here would break the 
layering of the compiler.

https://github.com/llvm/llvm-project/pull/113082
_______________________________________________
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

Reply via email to