Skip to content

Commit e94b095

Browse files
committed
extend test for opencl
1 parent 9fe9306 commit e94b095

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

sycl/source/detail/queue_impl.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,8 @@ event queue_impl::submitMemOpHelper(const std::shared_ptr<queue_impl> &Self,
499499
}
500500
}
501501

502-
if (isInOrder() && !isNoEventsMode) {
502+
if (isInOrder() &&
503+
(!isNoEventsMode || MContext->getBackend() == backend::opencl)) {
503504
auto &EventToStoreIn = MGraph.expired() ? MDefaultGraphDeps.LastEventPtr
504505
: MExtGraphDeps.LastEventPtr;
505506
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)