[Openmp-commits] [PATCH] D131089: [Libomptarget] Explicitly init / deinit libomptarget from the user
Shilei Tian via Phabricator via Openmp-commits
openmp-commits at lists.llvm.org
Thu Aug 4 07:51:50 PDT 2022
tianshilei1992 added a comment.
In D131089#3699662 <https://reviews.llvm.org/D131089#3699662>, @jhuber6 wrote:
> #include <dlfcn.h>
> #include <omp.h>
>
> int main() {
> #pragma omp parallel num_threads(2)
> {
> if (omp_get_thread_num() == 0) {
> void *h = dlopen("./liba.so", RTLD_LAZY);
> void (*ptr)() = dlsym(h, "foo");
> ptr();
> } else if (omp_get_thread_num() == 1) {
> void *h = dlopen("./libb.so", RTLD_LAZY);
> void (*ptr)() = dlsym(h, "foo");
> ptr();
> }
> }
> }
>
> Did this as a basic test, let me know if it's broken. It was fine initializing but it hung somewhere else when we try to launch the kernels. Same behavior before this patch so it's probably just broken elsewhere.
Is it fine w/o using mutex?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D131089/new/
https://reviews.llvm.org/D131089
More information about the Openmp-commits
mailing list