summaryrefslogtreecommitdiff
path: root/openmp
diff options
context:
space:
mode:
authorShilei Tian <i@tianshilei.me>2023-05-01 18:22:23 -0400
committerShilei Tian <i@tianshilei.me>2023-05-01 18:22:23 -0400
commit284e54d74c149e5c936c829f19c4f93a70456fde (patch)
tree11c6beef2e086a81e5e82f6747025f51321a0f16 /openmp
parent479e335fc37c06767654141358ea076ac066de11 (diff)
downloadllvm-284e54d74c149e5c936c829f19c4f93a70456fde.tar.gz
Revert "[OpenMP] Handle function calls from `libomp` to `libomptarget` correctly"
This reverts commit 479e335fc37c06767654141358ea076ac066de11. The assertion at `kmp_tasking.cpp(29)` is triggered.
Diffstat (limited to 'openmp')
-rw-r--r--openmp/runtime/src/kmp.h6
-rw-r--r--openmp/runtime/src/kmp_runtime.cpp13
-rw-r--r--openmp/runtime/src/kmp_tasking.cpp10
3 files changed, 3 insertions, 26 deletions
diff --git a/openmp/runtime/src/kmp.h b/openmp/runtime/src/kmp.h
index bd50d58f0fdc..43e723fa7387 100644
--- a/openmp/runtime/src/kmp.h
+++ b/openmp/runtime/src/kmp.h
@@ -1100,12 +1100,6 @@ extern void __kmp_init_target_mem();
/* ------------------------------------------------------------------------ */
-#if ENABLE_LIBOMPTARGET
-extern void __kmp_init_target_task();
-#endif
-
-/* ------------------------------------------------------------------------ */
-
#define KMP_UINT64_MAX \
(~((kmp_uint64)1 << ((sizeof(kmp_uint64) * (1 << 3)) - 1)))
diff --git a/openmp/runtime/src/kmp_runtime.cpp b/openmp/runtime/src/kmp_runtime.cpp
index a0a72f163e7c..776160289981 100644
--- a/openmp/runtime/src/kmp_runtime.cpp
+++ b/openmp/runtime/src/kmp_runtime.cpp
@@ -553,14 +553,6 @@ static void __kmp_fini_allocator() { __kmp_fini_memkind(); }
/* ------------------------------------------------------------------------ */
-#if ENABLE_LIBOMPTARGET
-static void __kmp_init_omptarget() {
- __kmp_init_target_task();
-}
-#endif
-
-/* ------------------------------------------------------------------------ */
-
#if KMP_DYNAMIC_LIB
#if KMP_OS_WINDOWS
@@ -7049,11 +7041,6 @@ static void __kmp_do_serial_initialize(void) {
__kmp_validate_locks();
-#if ENABLE_LIBOMPTARGET
- /* Initialize functions from libomptarget */
- __kmp_init_omptarget();
-#endif
-
/* Initialize internal memory allocator */
__kmp_init_allocator();
diff --git a/openmp/runtime/src/kmp_tasking.cpp b/openmp/runtime/src/kmp_tasking.cpp
index f441b0e9ef67..71922ed70800 100644
--- a/openmp/runtime/src/kmp_tasking.cpp
+++ b/openmp/runtime/src/kmp_tasking.cpp
@@ -22,12 +22,8 @@
#endif
#if ENABLE_LIBOMPTARGET
-static void (*tgt_target_nowait_query)(void **);
-
-void __kmp_init_target_task() {
- *(void **)(&tgt_target_nowait_query) = KMP_DLSYM("__tgt_target_nowait_query");
- KMP_ASSERT(tgt_target_nowait_query);
-}
+// Declaration of synchronization function from libomptarget.
+extern "C" void __tgt_target_nowait_query(void **) KMP_WEAK_ATTRIBUTE_INTERNAL;
#endif
/* forward declaration */
@@ -1809,7 +1805,7 @@ static void __kmp_invoke_task(kmp_int32 gtid, kmp_task_t *task,
// If we have a valid target async handle, that means that we have already
// executed the task routine once. We must query for the handle completion
// instead of re-executing the routine.
- tgt_target_nowait_query(&taskdata->td_target_data.async_handle);
+ __tgt_target_nowait_query(&taskdata->td_target_data.async_handle);
} else
#endif
if (task->routine != NULL) {