1
1
// REQUIRES: gpu, level_zero
2
2
3
3
// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out
4
- // 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
4
+ // 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
5
+ // 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
5
6
// UNSUPPORTED: ze_debug-1,ze_debug4
6
7
7
8
// Checks that with L0 device-scope events enabled the only host-visible L0
8
9
// event created is at the end of all kernels submission, when host waits for
9
10
// the last kernel's event.
10
11
//
11
- // CHECK-LABEL: Submitted all kernels
12
- // CHECK: ---> piEventsWait(
13
- // CHECK-NEXT: <unknown> : 1
14
- // CHECK: ZE ---> zeEventCreate(ZeEventPool, &ZeEventDesc, &ZeHostVisibleEvent)
15
- // CHECK: ZE ---> zeCommandListAppendWaitOnEvents(CommandList->first, 1, &ZeEvent)
16
- // CHECK-NEXT: ZE ---> zeCommandListAppendSignalEvent(CommandList->first,
17
- // ZeHostVisibleEvent)
18
- // CHECK: Completed all kernels
12
+ // MODE1-LABEL: Submitted all kernels
13
+ // MODE1: ---> piEventsWait(
14
+ // MODE1-NEXT: <unknown> : 1
15
+ // MODE1: PI ---> EventCreate(Context, true, &HostVisibleEvent)
16
+ // MODE1: ZE ---> zeEventCreate(ZeEventPool, &ZeEventDesc, &ZeEvent)
17
+ // MODE1: ZE ---> zeCommandListAppendWaitOnEvents(CommandList->first, 1,
18
+ // &ZeEvent) MODE1-NEXT: ZE --->
19
+ // zeCommandListAppendSignalEvent(CommandList->first, HostVisibleEvent->ZeEvent)
20
+ // MODE1: Completed all kernels
19
21
22
+ // With the SYCL_PI_LEVEL_ZERO_DEVICE_SCOPE_EVENTS=2 mode look for pattern that
23
+ // creates host-visible event just before command-list submission.
24
+ //
25
+ // MODE2: PI ---> EventCreate(Context, true, &HostVisibleEvent)
26
+ // MODE2: ZE ---> zeEventCreate(ZeEventPool, &ZeEventDesc, &ZeEvent)
27
+ // MODE2: ZE ---> zeCommandListAppendSignalEvent(CommandList->first,
28
+ // HostVisibleEvent->ZeEvent) MODE2: ZE --->
29
+ // zeCommandListClose(CommandList->first) MODE2: ZE --->
30
+ // zeCommandQueueExecuteCommandLists(ZeCommandQueue, 1, &ZeCommandList,
31
+ // CommandList->second.ZeFence)
32
+ //
20
33
#include < CL/sycl.hpp>
21
34
22
35
int main (int argc, char **argv) {
@@ -38,4 +51,4 @@ int main(int argc, char **argv) {
38
51
e.wait (); // Waits for the last kernel to complete.
39
52
std::cout << " Completed all kernels" << std::endl;
40
53
return 0 ;
41
- }
54
+ }
0 commit comments