llvm
llvm copied to clipboard
[SYCL][Graph] Optimize graph enqueue for in-order queues
Optimizes the enqueue() function of sycl graphs to bypass the scheduler whenever possible and avoid creating events when not needed.
- Refactors the executable graph
enqueue()to have different paths depending on workload:- The direct path will be used when there are no host-tasks or accessor requirements in the graph and the execution dependencies are considered safe to bypass the scheduler.
- The scheduler path will be used when there are requirements in the graph but no host-tasks or, if the execution dependencies require using the scheduler.
- The multiple partitions path will be used when the graph contains
host-taskswhich requires scheduling multiple graph partitions. The implementation was also changed to avoid adding unnecessary event dependencies to partition executions and avoiding copyingCGDatawhen possible.
- Extends the changes in https://github.com/intel/llvm/pull/18277 to sycl graphs. This means that no implicit events will be created when using in-order queues and graphs without
host-tasks. Also updates the handler to only request events from the graphenqueue()when they are needed.