Skip to content

Commit

Permalink
[SYCL] Reuse discarded L0 events in scope of command list (#7256)
Browse files Browse the repository at this point in the history
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)
  • Loading branch information
againull authored Nov 18, 2022
1 parent acca608 commit b1533c5
Show file tree
Hide file tree
Showing 3 changed files with 329 additions and 34 deletions.
1 change: 1 addition & 0 deletions sycl/doc/EnvironmentVariables.md
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,7 @@ variables in production code.</span>
| `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. |
| `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. |
| `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. |
| `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. |

## Debugging variables for CUDA Plugin

Expand Down
Loading

0 comments on commit b1533c5

Please sign in to comment.