|
10 | 10 | int main() {
|
11 | 11 | sycl::queue Q1({sycl::property::queue::in_order{}});
|
12 | 12 | sycl::queue Q2({sycl::property::queue::in_order{}});
|
| 13 | + sycl::queue Q3({sycl::property::queue::in_order{}, |
| 14 | + sycl::property::queue::enable_profiling{}}); |
13 | 15 |
|
14 | 16 | // Test case 1 - events in the barrier's waitlist are from different queues.
|
15 | 17 | std::cout << "Test1" << std::endl;
|
@@ -126,5 +128,30 @@ int main() {
|
126 | 128 | assert(Event11.get_info<sycl::info::event::command_execution_status>() ==
|
127 | 129 | sycl::info::event_command_status::complete);
|
128 | 130 |
|
| 131 | + // Test case 6 - submit barrier after queue sync with profiling enabled, i.e. |
| 132 | + // last event = nullptr. |
| 133 | + std::cout << "Test3" << std::endl; |
| 134 | + auto Event12 = Q3.submit( |
| 135 | + [&](sycl::handler &cgh) { cgh.single_task<class kernel12>([]() {}); }); |
| 136 | + auto Event13 = Q3.submit( |
| 137 | + [&](sycl::handler &cgh) { cgh.single_task<class kernel13>([]() {}); }); |
| 138 | + Q3.wait(); |
| 139 | + |
| 140 | + // CHECK: Test3 |
| 141 | + // CHECK: ---> piEnqueueEventsWaitWithBarrier( |
| 142 | + // CHECK: ZE ---> zeEventCreate |
| 143 | + // CHECK-NOT: ZE ---> zeCommandListAppendWaitOnEvents |
| 144 | + // CHECK-NOT: ZE ---> zeCommandListAppendSignalEvent |
| 145 | + // CHECK: ZE ---> zeCommandListAppendBarrier |
| 146 | + // CHECK: ) ---> pi_result : PI_SUCCESS |
| 147 | + auto BarrierEvent6 = Q3.ext_oneapi_submit_barrier({Event12, Event13}); |
| 148 | + BarrierEvent6.wait(); |
| 149 | + |
| 150 | + // Check that kernel events are completed after waiting for barrier event. |
| 151 | + assert(Event12.get_info<sycl::info::event::command_execution_status>() == |
| 152 | + sycl::info::event_command_status::complete); |
| 153 | + assert(Event13.get_info<sycl::info::event::command_execution_status>() == |
| 154 | + sycl::info::event_command_status::complete); |
| 155 | + |
129 | 156 | return 0;
|
130 | 157 | }
|
0 commit comments