Skip to content

Commit 156335d

Browse files
committed
extend test for opencl
1 parent 6355202 commit 156335d

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

sycl/source/detail/queue_impl.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ queue_impl::getLastEvent(const std::shared_ptr<queue_impl> &Self) {
295295
auto &LastEvent = MGraph.expired() ? MDefaultGraphDeps.LastEventPtr
296296
: MExtGraphDeps.LastEventPtr;
297297
// If the event comes from a graph, we must return it.
298-
if (LastEvent && (!LastEvent->isNOP() || LastEvent->hasCommandGraph()))
298+
if (LastEvent)
299299
return detail::createSyclObjFromImpl<event>(LastEvent);
300300
// We insert a marker to represent an event at end.
301301
return detail::createSyclObjFromImpl<event>(insertMarkerEvent(Self));
@@ -500,7 +500,8 @@ event queue_impl::submitMemOpHelper(const std::shared_ptr<queue_impl> &Self,
500500
}
501501
}
502502

503-
if (isInOrder() && !isNoEventsMode) {
503+
if (isInOrder() &&
504+
(!isNoEventsMode || MContext->getBackend() == backend::opencl)) {
504505
auto &EventToStoreIn = MGraph.expired() ? MDefaultGraphDeps.LastEventPtr
505506
: MExtGraphDeps.LastEventPtr;
506507
EventToStoreIn = EventImpl;

sycl/test-e2e/InOrderEventsExt/get_last_event.cpp

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,17 @@ int Check(const sycl::queue &Q, const char *CheckName, const F &CheckFunc) {
3636
<< std::endl;
3737
return 1;
3838
}
39-
if (LastEvent->get_info<sycl::info::event::command_execution_status>() ==
40-
sycl::info::event_command_status::complete &&
41-
E->get_info<sycl::info::event::command_execution_status>() !=
42-
sycl::info::event_command_status::complete) {
39+
if (Q.get_backend() == sycl::backend::opencl) {
40+
if (*E != *LastEvent) {
41+
std::cout << "opencl backend should store last event in the queue"
42+
<< std::endl;
43+
return 1;
44+
}
45+
} else if (LastEvent->get_info<
46+
sycl::info::event::command_execution_status>() ==
47+
sycl::info::event_command_status::complete &&
48+
E->get_info<sycl::info::event::command_execution_status>() !=
49+
sycl::info::event_command_status::complete) {
4350
std::cout << "ext_oneapi_get_last_event() returned an event that is "
4451
"complete, but the event returned by CheckFunc() is not."
4552
<< std::endl;

0 commit comments

Comments
 (0)