#include <cstdint>
#include <deque>
#include <functional>
-#include <optional>
#include <stddef.h>
#include <stdint.h>
#include <type_traits>
/// 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<bool> isDone();
+ /// otherwise.
+ bool isDone();
/// Add a new post-processing function to be executed after synchronization.
///
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;
}
return BufferLocations.back();
}
-std::optional<bool> 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();
}
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.