llvm
llvm copied to clipboard
[SYCL] Events caching for in-order queues in the L0 plugin
For in-order queues we can reuse events even before they are completed and released. Simplified scheme looks like this: submit command1 [] -> pi_event1 (ze_event1) submit command2 [dep pi_event1] -> pi_event2 (ze_event2) submit reset ze_event1 submit command3 [dep pi_event2] -> pi_event3 (ze_event1) So, in this example same native handle ze_event1 is used for command 1 and command3.
There are several levels of caching supported:
- Caching disabled.
- Only discarded device-scope events are cached and reused for in-order queues.
- All device-scope events are cached and reused for in-order queues.
For 3. external ref count is used to track number of external references. Event can be reused only when this number turns to zero.
E2E tests: https://github.com/intel/llvm-test-suite/pull/1263
Fix for SYCL/Plugin/level_zero_device_scope_events.cpp test is here: https://github.com/intel/llvm-test-suite/pull/1179
HIP backend AtomicRef failures are unrelated.
Hi @steffenlarsen, @sergey-semenov, could you please review these changes (as far as I know you contributed to L0 plugin) by any chance because Sergey Maslov is in sick leave.