Skip to content
This repository was archived by the owner on Mar 28, 2023. It is now read-only.

[SYCL] Make checks more robust in the level_zero_device_scope_events.cpp #1179

Merged
merged 2 commits into from
Aug 31, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 10 additions & 11 deletions SYCL/Plugin/level_zero_device_scope_events.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,27 +9,26 @@
// event created is at the end of all kernels submission, when host waits for
// the last kernel's event.
//
// clang-format off
// MODE1-LABEL: Submitted all kernels
// MODE1: ---> piEventsWait(
// MODE1-NEXT: <unknown> : 1
// MODE1: PI ---> EventCreate(Queue->Context, Queue, ForceHostVisible
// MODE1: ze_event_pool_desc_t flags set to: 1
// MODE1: ZE ---> zeEventCreate(ZeEventPool, &ZeEventDesc, &ZeEvent)
// MODE1: ZE ---> zeCommandListAppendWaitOnEvents(CommandList->first, 1,
// &ZeEvent) MODE1-NEXT: ZE --->
// zeCommandListAppendSignalEvent(CommandList->first, HostVisibleEvent->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(Queue->Context, Queue, ForceHostVisible
// MODE2: ze_event_pool_desc_t flags set to: 1
// 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)
///
// MODE2: ZE ---> zeCommandListAppendSignalEvent(CommandList->first, HostVisibleEvent->ZeEvent)
// MODE2: ZE ---> zeCommandListClose(CommandList->first)
// MODE2: ZE ---> zeCommandQueueExecuteCommandLists(ZeCommandQueue, 1, &ZeCommandList, CommandList->second.ZeFence)
// clang-format on

#include <iostream>
#include <sycl/sycl.hpp>

Expand Down