[Openmp-commits] [PATCH] D131089: [Libomptarget] Explicitly init / deinit libomptarget from the user
Joseph Huber via Phabricator via Openmp-commits
openmp-commits at lists.llvm.org
Thu Aug 4 07:45:43 PDT 2022
jhuber6 added a comment.
#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.
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