From 48c8e16020483b9a2699b7bacda99e8fd0a6d051 Mon Sep 17 00:00:00 2001 From: Joseph Huber Date: Thu, 16 Feb 2023 14:50:31 -0600 Subject: [PATCH] Revert "[Libomptarget] Check errors when synchronizing the async queue" This reverts commit 861709107b43d40ad366e0efd225cb804be3b44d. Reverting this to reland as it will make it easier to backport. --- openmp/libomptarget/include/omptarget.h | 5 ++--- openmp/libomptarget/src/interface.cpp | 5 +---- openmp/libomptarget/src/omptarget.cpp | 6 ++---- openmp/libomptarget/src/private.h | 5 +---- 4 files changed, 6 insertions(+), 15 deletions(-) diff --git a/openmp/libomptarget/include/omptarget.h b/openmp/libomptarget/include/omptarget.h index dd577e4..9df9e22 100644 --- a/openmp/libomptarget/include/omptarget.h +++ b/openmp/libomptarget/include/omptarget.h @@ -17,7 +17,6 @@ #include #include #include -#include #include #include #include @@ -248,8 +247,8 @@ public: /// functions will be executed once and unregistered afterwards. /// /// \returns true if there is no pending asynchronous operations, false - /// otherwise. We return a null value in the case of an error from the plugin. - std::optional isDone(); + /// otherwise. + bool isDone(); /// Add a new post-processing function to be executed after synchronization. /// diff --git a/openmp/libomptarget/src/interface.cpp b/openmp/libomptarget/src/interface.cpp index 79d465c..beea0c2 100644 --- a/openmp/libomptarget/src/interface.cpp +++ b/openmp/libomptarget/src/interface.cpp @@ -412,12 +412,9 @@ EXTERN void __tgt_target_nowait_query(void **AsyncHandle) { if (QueryCounter.isAboveThreshold()) AsyncInfo->SyncType = AsyncInfoTy::SyncTy::BLOCKING; - auto DoneOrErr = AsyncInfo->isDone(); - if (!DoneOrErr) - FATAL_MESSAGE0(1, "Error while synchronizing the async queue\n"); // If there are device operations still pending, return immediately without // deallocating the handle and increase the current thread query count. - if (!*DoneOrErr) { + if (!AsyncInfo->isDone()) { QueryCounter.increment(); return; } diff --git a/openmp/libomptarget/src/omptarget.cpp b/openmp/libomptarget/src/omptarget.cpp index 8b32324..b0d10df 100644 --- a/openmp/libomptarget/src/omptarget.cpp +++ b/openmp/libomptarget/src/omptarget.cpp @@ -51,10 +51,8 @@ void *&AsyncInfoTy::getVoidPtrLocation() { return BufferLocations.back(); } -std::optional AsyncInfoTy::isDone() { - if (int Result = synchronize()) - return std::nullopt; - +bool AsyncInfoTy::isDone() { + synchronize(); // The async info operations are completed when the internal queue is empty. return isQueueEmpty(); } diff --git a/openmp/libomptarget/src/private.h b/openmp/libomptarget/src/private.h index 7d3f8b9..9f15619 100644 --- a/openmp/libomptarget/src/private.h +++ b/openmp/libomptarget/src/private.h @@ -250,12 +250,9 @@ public: if (AsyncInfo == &LocalAsyncInfo) return; - auto DoneOrErr = AsyncInfo->isDone(); - if (!DoneOrErr) - FATAL_MESSAGE0(1, "Error while synchronizing the async queue\n"); // If the are device operations still pending, return immediately without // deallocating the handle. - if (!*DoneOrErr) + if (!AsyncInfo->isDone()) return; // Delete the handle and unset it from the OpenMP task data. -- 2.7.4