diff --git a/SYCL/Plugin/level_zero_device_scope_events.cpp b/SYCL/Plugin/level_zero_device_scope_events.cpp index 2adedbe550..35c658ec69 100644 --- a/SYCL/Plugin/level_zero_device_scope_events.cpp +++ b/SYCL/Plugin/level_zero_device_scope_events.cpp @@ -1,22 +1,35 @@ // REQUIRES: gpu, level_zero // RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out -// RUN: env SYCL_PI_LEVEL_ZERO_DEVICE_SCOPE_EVENTS=1 SYCL_PI_TRACE=2 ZE_DEBUG=1 %GPU_RUN_PLACEHOLDER %t.out 2>&1 %GPU_CHECK_PLACEHOLDER +// RUN: env SYCL_PI_LEVEL_ZERO_DEVICE_SCOPE_EVENTS=1 SYCL_PI_TRACE=-1 ZE_DEBUG=1 %GPU_RUN_PLACEHOLDER %t.out 2>&1 | FileCheck --check-prefixes=MODE1 %s +// RUN: env SYCL_PI_LEVEL_ZERO_DEVICE_SCOPE_EVENTS=2 SYCL_PI_TRACE=-1 ZE_DEBUG=1 %GPU_RUN_PLACEHOLDER %t.out 2>&1 | FileCheck --check-prefixes=MODE2 %s // UNSUPPORTED: ze_debug-1,ze_debug4 // Checks that with L0 device-scope events enabled the only host-visible L0 // event created is at the end of all kernels submission, when host waits for // the last kernel's event. // -// CHECK-LABEL: Submitted all kernels -// CHECK: ---> piEventsWait( -// CHECK-NEXT: : 1 -// CHECK: ZE ---> zeEventCreate(ZeEventPool, &ZeEventDesc, &ZeHostVisibleEvent) -// CHECK: ZE ---> zeCommandListAppendWaitOnEvents(CommandList->first, 1, &ZeEvent) -// CHECK-NEXT: ZE ---> zeCommandListAppendSignalEvent(CommandList->first, -// ZeHostVisibleEvent) -// CHECK: Completed all kernels +// MODE1-LABEL: Submitted all kernels +// MODE1: ---> piEventsWait( +// MODE1-NEXT: : 1 +// MODE1: PI ---> EventCreate(Context, true, &HostVisibleEvent) +// MODE1: ZE ---> zeEventCreate(ZeEventPool, &ZeEventDesc, &ZeEvent) +// MODE1: ZE ---> zeCommandListAppendWaitOnEvents(CommandList->first, 1, +// &ZeEvent) MODE1-NEXT: ZE ---> +// zeCommandListAppendSignalEvent(CommandList->first, HostVisibleEvent->ZeEvent) +// MODE1: Completed all kernels +// With the SYCL_PI_LEVEL_ZERO_DEVICE_SCOPE_EVENTS=2 mode look for pattern that +// creates host-visible event just before command-list submission. +// +// MODE2: PI ---> EventCreate(Context, true, &HostVisibleEvent) +// MODE2: ZE ---> zeEventCreate(ZeEventPool, &ZeEventDesc, &ZeEvent) +// MODE2: ZE ---> zeCommandListAppendSignalEvent(CommandList->first, +// HostVisibleEvent->ZeEvent) MODE2: ZE ---> +// zeCommandListClose(CommandList->first) MODE2: ZE ---> +// zeCommandQueueExecuteCommandLists(ZeCommandQueue, 1, &ZeCommandList, +// CommandList->second.ZeFence) +// #include int main(int argc, char **argv) { @@ -38,4 +51,4 @@ int main(int argc, char **argv) { e.wait(); // Waits for the last kernel to complete. std::cout << "Completed all kernels" << std::endl; return 0; -} \ No newline at end of file +}