llvm
6cb62ce8 - [SYCL][NFC] Query the last event once per async allocation (#23125)

Commit
4 days ago
[SYCL][NFC] Query the last event once per async allocation (#23125) ### The problem The queue shortcuts for `async_malloc()` / `async_malloc_from_pool()` call `queue::ext_oneapi_get_last_event()` twice — once to test it, once to read it: ```cpp if (q.is_in_order() && q.ext_oneapi_get_last_event()) h.depends_on(q.ext_oneapi_get_last_event().value()); ``` `queue_impl::getLastEvent()` does not cache what it returns. When the queue has no last event recorded it calls `insertMarkerEvent()`, which enqueues a `urEnqueueEventsWait` marker and does **not** store it back into `LastEventPtr`. The second call therefore enqueues a *second* marker, and the event produced by the first is destroyed immediately with its result thrown away. Every async allocation on an in-order queue costs an extra marker command plus an extra UR round-trip for nothing. ### The fix Query it once into a local. No functional change: the command still depends on a marker that orders it after everything previously submitted to the in-order queue. --- Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Author
Parents
Loading