Skip to content

Commit 650a53d

Browse files
committed
[SYCL] Update test for new mode SYCL_PI_LEVEL_ZERO_DEVICE_SCOPE_EVENTS=2 (intel#771)
1 parent ef2a19c commit 650a53d

File tree

1 file changed

+23
-10
lines changed

1 file changed

+23
-10
lines changed

SYCL/Plugin/level_zero_device_scope_events.cpp

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,35 @@
11
// REQUIRES: gpu, level_zero
22

33
// 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
56
// UNSUPPORTED: ze_debug-1,ze_debug4
67

78
// Checks that with L0 device-scope events enabled the only host-visible L0
89
// event created is at the end of all kernels submission, when host waits for
910
// the last kernel's event.
1011
//
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
1921

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+
//
2033
#include <CL/sycl.hpp>
2134

2235
int main(int argc, char **argv) {
@@ -38,4 +51,4 @@ int main(int argc, char **argv) {
3851
e.wait(); // Waits for the last kernel to complete.
3952
std::cout << "Completed all kernels" << std::endl;
4053
return 0;
41-
}
54+
}

0 commit comments

Comments
 (0)