Skip to content

Commit b1533c5

Browse files
authored
[SYCL] Reuse discarded L0 events in scope of command list (#7256)
Patch implements reset and reuse of Level Zero events in scope of cmd list. Same level zero events are reused inside different command lists in scope of the queue, we need new event only to switch between command lists. The scheme in scope of command list looks like this: Operation1 = zeCommantListAppendMemoryCopy (signal event1) zeCommandListAppendBarrier(wait for event1) zeCommandListAppendEventReset(event1) Operation2 = zeCommandListAppendMemoryCopy (signal event2) zeCommandListAppendBarrier(wait for event2) zeCommandListAppendEventReset(event2) Operation3 = zeCommandListAppendMemoryCopy (signal event1) If we switch to a different command list then we signal new event and insert a barrier into new command list waiting on that event. CmdList1: Operation1 = zeCommantListAppendMemoryCopy (signal event1) zeCommandListAppendBarrier(wait for event1) zeCommandListAppendEventReset(event1) zeCommandListAppendSignalEvent(NewEvent) CmdList2: zeCommandListAppendBarrier(wait for NewEvent)
1 parent acca608 commit b1533c5

File tree

3 files changed

+329
-34
lines changed

3 files changed

+329
-34
lines changed

sycl/doc/EnvironmentVariables.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,7 @@ variables in production code.</span>
249249
| `SYCL_PI_LEVEL_ZERO_USE_MULTIPLE_COMMANDLIST_BARRIERS` | Integer | When set to a positive value enables use of multiple Level Zero commandlists when submitting barriers. Default is 1. |
250250
| `SYCL_PI_LEVEL_ZERO_USE_COPY_ENGINE_FOR_FILL` | Integer | When set to a positive value enables use of a copy engine for memory fill operations. Default is 0. |
251251
| `SYCL_PI_LEVEL_ZERO_SINGLE_ROOT_DEVICE_BUFFER_MIGRATION` | Integer | When set to "0" tells to use single root-device allocation for all devices in a context where all devices have same root. Otherwise performs regular buffer migration. Default is 1. |
252+
| `SYCL_PI_LEVEL_ZERO_REUSE_DISCARDED_EVENTS` | Integer | When set to a positive value enables the mode when discarded Level Zero events are reset and reused in scope of the same in-order queue based on the dependency chain between commands. Default is 1. |
252253

253254
## Debugging variables for CUDA Plugin
254255

0 commit comments

Comments
 (0)