Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 0 additions & 29 deletions sycl/source/queue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -334,24 +334,6 @@ void queue::wait_and_throw_proxy(const detail::code_location &CodeLoc) {
impl->wait_and_throw(CodeLoc);
}

static event
getBarrierEventForInorderQueueHelper(detail::queue_impl &QueueImpl) {
// This function should not be called when a queue is recording to a graph,
// as a graph can record from multiple queues and we cannot guarantee the
// last node added by an in-order queue will be the last node added to the
// graph.
assert(!QueueImpl.hasCommandGraph() &&
"Should not be called in on graph recording.");

sycl::detail::optional<event> LastEvent = QueueImpl.getLastEvent();
if (LastEvent)
return *LastEvent;

// If there was no last event, we create an empty one.
return detail::createSyclObjFromImpl<event>(
detail::event_impl::create_default_event());
}

/// Prevents any commands submitted afterward to this queue from executing
/// until all commands previously submitted to this queue have entered the
/// complete state.
Expand All @@ -374,17 +356,6 @@ event queue::ext_oneapi_submit_barrier(const detail::code_location &CodeLoc) {
/// group is being enqueued on.
event queue::ext_oneapi_submit_barrier(const std::vector<event> &WaitList,
const detail::code_location &CodeLoc) {
bool AllEventsEmptyOrNop = std::all_of(
begin(WaitList), end(WaitList), [&](const event &Event) -> bool {
detail::event_impl &EventImpl = *detail::getSyclObjImpl(Event);
return (EventImpl.isDefaultConstructed() || EventImpl.isNOP()) &&
!EventImpl.hasCommandGraph();
});
if (is_in_order() && !impl->hasCommandGraph() && !impl->MIsProfilingEnabled &&
AllEventsEmptyOrNop) {
return getBarrierEventForInorderQueueHelper(*impl);
}

if (WaitList.empty())
return submit([=](handler &CGH) { CGH.ext_oneapi_barrier(); }, CodeLoc);
else
Expand Down
Loading