DPC++ Runtime
Runtime libraries for oneAPI DPC++
scheduler.hpp
Go to the documentation of this file.
1 //==-------------- scheduler.hpp - SYCL standard header file ---------------==//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #pragma once
10 
11 #include <detail/cg.hpp>
15 
16 #include <cstddef>
17 #include <memory>
18 #include <queue>
19 #include <set>
20 #include <shared_mutex>
21 #include <unordered_map>
22 #include <unordered_set>
23 #include <vector>
24 
170 
171 // For testing purposes
172 class MockScheduler;
173 
174 namespace sycl {
175 inline namespace _V1 {
176 namespace ext::oneapi::experimental::detail {
177 class exec_graph_impl;
178 class node_impl;
179 } // namespace ext::oneapi::experimental::detail
180 namespace detail {
181 class queue_impl;
182 class event_impl;
183 class context_impl;
184 class DispatchHostTask;
185 
186 using ContextImplPtr = std::shared_ptr<detail::context_impl>;
187 using EventImplPtr = std::shared_ptr<detail::event_impl>;
188 using QueueImplPtr = std::shared_ptr<detail::queue_impl>;
189 using StreamImplPtr = std::shared_ptr<detail::stream_impl>;
190 
191 using QueueIdT = std::hash<std::shared_ptr<detail::queue_impl>>::result_type;
192 using CommandPtr = std::unique_ptr<Command>;
193 using FusionList = std::unique_ptr<KernelFusionCommand>;
194 using FusionMap = std::unordered_map<QueueIdT, FusionList>;
195 
202 struct MemObjRecord {
203  MemObjRecord(ContextImplPtr Ctx, std::size_t LeafLimit,
204  LeavesCollection::AllocateDependencyF AllocateDependency)
205  : MReadLeaves{this, LeafLimit, AllocateDependency},
206  MWriteLeaves{this, LeafLimit, AllocateDependency}, MCurContext{Ctx} {}
207  // Contains all allocation commands for the memory object.
208  std::vector<AllocaCommandBase *> MAllocaCommands;
209 
210  // Contains latest read only commands working with memory object.
212 
213  // Contains latest write commands working with memory object.
215 
216  // The context which has the latest state of the memory object.
218 
219  // The mode this object can be accessed from the host (host_accessor).
220  // Valid only if the current usage is on host.
222 
223  // The flag indicates that the content of the memory object was/will be
224  // modified. Used while deciding if copy back needed.
225  bool MMemModified = false;
226 };
227 
262 //
263 // +----------+ +----------+ +----------+
264 // | | | | | |
265 // | Allocate |<----| Execute |<----| Execute |
266 // | | | | | |
267 // +----------+ +----------+ +----------+
268 //
296 // +----------+
297 // | |
298 // | D |
299 // | |
300 // +----------+
301 // / \
302 // / \
303 // v v
304 // +----------+ +----------+
305 // | | | |
306 // | B | | C |
307 // | | | |
308 // +----------+ +----------+
309 // \ /
310 // \ /
311 // v v
312 // +----------+
313 // | |
314 // | A |
315 // | |
316 // +----------+
366 class Scheduler {
367 public:
381  addCG(std::unique_ptr<detail::CG> CommandGroup, const QueueImplPtr &Queue,
382  bool EventNeeded,
383  sycl::detail::pi::PiExtCommandBuffer CommandBuffer = nullptr,
384  const std::vector<sycl::detail::pi::PiExtSyncPoint> &Dependencies = {});
385 
393 
404 
405  void waitForEvent(const EventImplPtr &Event, bool *Success = nullptr);
406 
429  bool removeMemoryObject(detail::SYCLMemObjI *MemObj, bool StrictLock = true);
430 
442 
447  void releaseHostAccessor(Requirement *Req);
448 
450  static Scheduler &getInstance();
452  static bool isInstanceAlive();
453 
454  static MemObjRecord *getMemObjRecord(const Requirement *const Req);
455 
456  void deferMemObjRelease(const std::shared_ptr<detail::SYCLMemObjI> &MemObj);
457 
458  void startFusion(QueueImplPtr Queue);
459 
460  void cleanUpCmdFusion(sycl::detail::queue_impl *Queue);
461 
462  void cancelFusion(QueueImplPtr Queue);
463 
466  QueueImplPtr Queue, const RTDeviceBinaryImage *BinImage,
467  const std::string &KernelName, std::vector<unsigned char> &SpecConstBlob);
468 
469  bool isInFusionMode(QueueIdT Queue);
470 
473 
474  void enqueueCommandForCG(EventImplPtr NewEvent,
475  std::vector<Command *> &AuxilaryCmds,
476  BlockingT Blocking = NON_BLOCKING);
477 
487  std::vector<std::shared_ptr<ext::oneapi::experimental::detail::node_impl>>
488  Nodes,
489  const QueueImplPtr &Queue, std::vector<Requirement *> Requirements,
490  std::vector<detail::EventImplPtr> &Events);
491 
492  static bool
493  areEventsSafeForSchedulerBypass(const std::vector<sycl::event> &DepEvents,
494  ContextImplPtr Context);
495  static bool
496  areEventsSafeForSchedulerBypass(const std::vector<EventImplPtr> &DepEvents,
497  ContextImplPtr Context);
498 
499 protected:
500  using RWLockT = std::shared_timed_mutex;
501  using ReadLockT = std::shared_lock<RWLockT>;
502  using WriteLockT = std::unique_lock<RWLockT>;
503 
507 #ifdef _WIN32
508  WriteLockT Lock(MGraphLock, std::defer_lock);
509  while (!Lock.try_lock_for(std::chrono::milliseconds(10))) {
510  // Without yield while loop acts like endless while loop and occupies the
511  // whole CPU when multiple command groups are created in multiple host
512  // threads
513  std::this_thread::yield();
514  }
515 #else
516  WriteLockT Lock(MGraphLock);
517  // It is a deadlock on UNIX in implementation of lock and lock_shared, if
518  // try_lock in the loop above will be executed, so using a single lock here
519 #endif // _WIN32
520  return Lock;
521  }
522 
526 #ifdef _WIN32
527  WriteLockT Lock(MFusionMapLock, std::defer_lock);
528  while (!Lock.try_lock_for(std::chrono::milliseconds(10))) {
529  // Without yield while loop acts like endless while loop and occupies the
530  // whole CPU when multiple command groups are created in multiple host
531  // threads
532  std::this_thread::yield();
533  }
534 #else
536  // It is a deadlock on UNIX in implementation of lock and lock_shared, if
537  // try_lock in the loop above will be executed, so using a single lock here
538 #endif // _WIN32
539  return Lock;
540  }
541 
545 
549 
550  void cleanupCommands(const std::vector<Command *> &Cmds);
551 
553 
554  static void enqueueLeavesOfReqUnlocked(const Requirement *const Req,
555  ReadLockT &GraphReadLock,
556  std::vector<Command *> &ToCleanUp);
557 
558  static void
559  enqueueUnblockedCommands(const std::vector<EventImplPtr> &CmdsToEnqueue,
560  ReadLockT &GraphReadLock,
561  std::vector<Command *> &ToCleanUp);
562 
563  // May lock graph with read and write modes during execution.
564  void cleanupDeferredMemObjects(BlockingT Blocking);
565 
566  // POD struct to convey some additional information from GraphBuilder::addCG
567  // to the Scheduler to support kernel fusion.
572  };
573 
575  void takeAuxiliaryResources(const EventImplPtr &Dst, const EventImplPtr &Src);
577  EventImplPtr &Event, std::vector<std::shared_ptr<const void>> Resources);
578  void cleanupAuxiliaryResources(BlockingT Blocking);
579 
586  class GraphBuilder {
587  public:
588  GraphBuilder();
589 
602  std::unique_ptr<detail::CG> CommandGroup, const QueueImplPtr &Queue,
603  std::vector<Command *> &ToEnqueue, bool EventNeeded,
604  sycl::detail::pi::PiExtCommandBuffer CommandBuffer = nullptr,
605  const std::vector<sycl::detail::pi::PiExtSyncPoint> &Dependencies = {});
606 
611  Command *addCGUpdateHost(std::unique_ptr<detail::CG> CommandGroup,
612  std::vector<Command *> &ToEnqueue);
613 
617  Command *addCopyBack(Requirement *Req, std::vector<Command *> &ToEnqueue);
618 
623  std::vector<Command *> &ToEnqueue);
624 
626  void optimize();
627 
630  void optimize(const EventImplPtr &Event);
631 
632  void cleanupCommand(Command *Cmd, bool AllowUnsubmitted = false);
633 
640  void rescheduleCommand(Command *Cmd, const QueueImplPtr &Queue);
641 
645 
649  const Requirement *Req);
650 
653 
656 
658  void removeRecordForMemObj(SYCLMemObjI *MemObject);
659 
661  void addNodeToLeaves(MemObjRecord *Record, Command *Cmd,
663  std::vector<Command *> &ToEnqueue);
664 
666  void updateLeaves(const std::set<Command *> &Cmds, MemObjRecord *Record,
668  std::vector<Command *> &ToCleanUp);
669 
679  Command *connectDepEvent(Command *const Cmd, const EventImplPtr &DepEvent,
680  const DepDesc &Dep,
681  std::vector<Command *> &ToCleanUp);
682 
683  void startFusion(QueueImplPtr Queue);
684 
687  void cleanUpCmdFusion(sycl::detail::queue_impl *Queue);
688 
689  void cancelFusion(QueueImplPtr Queue, std::vector<Command *> &ToEnqueue);
690 
692  std::vector<Command *> &ToEnqueue,
693  const property_list &);
694 
696 
707  std::vector<
708  std::shared_ptr<ext::oneapi::experimental::detail::node_impl>>
709  Nodes,
710  const QueueImplPtr &Queue, std::vector<Requirement *> Requirements,
711  std::vector<detail::EventImplPtr> &Events,
712  std::vector<Command *> &ToEnqueue);
713 
714  std::vector<SYCLMemObjI *> MMemObjs;
715 
716  private:
726  Command *insertMemoryMove(MemObjRecord *Record, Requirement *Req,
727  const QueueImplPtr &Queue,
728  std::vector<Command *> &ToEnqueue);
729 
730  // Inserts commands required to remap the memory object to its current host
731  // context so that the required access mode becomes valid.
732  Command *remapMemoryObject(MemObjRecord *Record, Requirement *Req,
733  AllocaCommandBase *HostAllocaCmd,
734  std::vector<Command *> &ToEnqueue);
735 
737  insertUpdateHostReqCmd(MemObjRecord *Record, Requirement *Req,
738  const QueueImplPtr &Queue,
739  std::vector<Command *> &ToEnqueue);
740 
742  std::set<Command *> findDepsForReq(MemObjRecord *Record,
743  const Requirement *Req,
744  const ContextImplPtr &Context);
745 
746  EmptyCommand *addEmptyCmd(Command *Cmd,
747  const std::vector<Requirement *> &Req,
748  Command::BlockReason Reason,
749  std::vector<Command *> &ToEnqueue);
750 
751  void createGraphForCommand(Command *NewCmd, CG &CG, bool isInteropTask,
752  std::vector<Requirement *> &Reqs,
753  const std::vector<detail::EventImplPtr> &Events,
754  QueueImplPtr Queue,
755  std::vector<Command *> &ToEnqueue);
756 
757  protected:
760 
763  const Requirement *Req,
764  const ContextImplPtr &Context,
765  bool AllowConst = true);
766 
767  friend class Command;
768 
769  private:
770  friend class ::MockScheduler;
771 
776  getOrCreateAllocaForReq(MemObjRecord *Record, const Requirement *Req,
777  const QueueImplPtr &Queue,
778  std::vector<Command *> &ToEnqueue);
779 
780  void markModifiedIfWrite(MemObjRecord *Record, Requirement *Req);
781 
782  FusionMap::iterator findFusionList(QueueIdT Id) {
783  return MFusionMap.find(Id);
784  }
785 
786  void removeNodeFromGraph(Command *Node, std::vector<Command *> &ToEnqueue);
787 
790  std::queue<Command *> MCmdsToVisit;
792  std::vector<Command *> MVisitedCmds;
793 
796  FusionMap MFusionMap;
797 
802  void printGraphAsDot(const char *ModeName);
803  enum PrintOptions {
804  BeforeAddCG = 0,
805  AfterAddCG,
806  BeforeAddCopyBack,
807  AfterAddCopyBack,
808  BeforeAddHostAcc,
809  AfterAddHostAcc,
810  AfterFusionComplete,
811  AfterFusionCancel,
812  Size
813  };
814  std::array<bool, PrintOptions::Size> MPrintOptionsArray{false};
815  };
816 
890  public:
902  static void waitForEvent(const EventImplPtr &Event,
903  ReadLockT &GraphReadLock,
904  std::vector<Command *> &ToCleanUp,
905  bool LockTheLock = true, bool *Success = nullptr);
906 
916  static bool enqueueCommand(Command *Cmd, ReadLockT &GraphReadLock,
917  EnqueueResultT &EnqueueResult,
918  std::vector<Command *> &ToCleanUp,
919  Command *RootCommand,
920  BlockingT Blocking = NON_BLOCKING);
921 
934  static bool handleBlockingCmd(Command *Cmd, EnqueueResultT &EnqueueResult,
935  Command *RootCommand, BlockingT Blocking);
936  };
937 
946  void waitForRecordToFinish(MemObjRecord *Record, ReadLockT &GraphReadLock);
947  bool checkLeavesCompletion(MemObjRecord *Record);
948 
952 
953  std::vector<Command *> MDeferredCleanupCommands;
955 
956  std::vector<std::shared_ptr<SYCLMemObjI>> MDeferredMemObjRelease;
958 
959  std::unordered_map<EventImplPtr, std::vector<std::shared_ptr<const void>>>
962 
963  friend class Command;
964  friend class DispatchHostTask;
965  friend class queue_impl;
966  friend class event_impl;
967  friend class ::MockScheduler;
968 
969 private:
970  static void printFusionWarning(const std::string &Message);
971 
972  static KernelFusionCommand *isPartOfActiveFusion(Command *Cmd);
973 };
974 
975 } // namespace detail
976 } // namespace _V1
977 } // namespace sycl
Base class for memory allocation commands.
Definition: commands.hpp:456
Base class for all types of command groups.
Definition: cg.hpp:161
The Command class represents some action that needs to be performed on one or more memory objects.
Definition: commands.hpp:109
The empty command does nothing during enqueue.
Definition: commands.hpp:414
The KernelFusionCommand is placed in the execution graph together with the individual kernels of the ...
Definition: commands.hpp:729
A wrapper for CircularBuffer class along with collection for host accessor's EmptyCommands.
std::function< void(Command *, Command *, MemObjRecord *, EnqueueListT &)> AllocateDependencyF
void optimize(const EventImplPtr &Event)
[Provisional] Optimizes subgraph that consists of command associated with Event passed and its depend...
Command * addCommandGraphUpdate(ext::oneapi::experimental::detail::exec_graph_impl *Graph, std::vector< std::shared_ptr< ext::oneapi::experimental::detail::node_impl >> Nodes, const QueueImplPtr &Queue, std::vector< Requirement * > Requirements, std::vector< detail::EventImplPtr > &Events, std::vector< Command * > &ToEnqueue)
Adds a command buffer update operation to the execution graph.
void cleanupCommand(Command *Cmd, bool AllowUnsubmitted=false)
MemObjRecord * getOrInsertMemObjRecord(const QueueImplPtr &Queue, const Requirement *Req)
Command * addCGUpdateHost(std::unique_ptr< detail::CG > CommandGroup, std::vector< Command * > &ToEnqueue)
Registers a command group that updates host memory to the latest state.
std::vector< SYCLMemObjI * > MMemObjs
Definition: scheduler.hpp:714
void decrementLeafCountersForRecord(MemObjRecord *Record)
Decrements leaf counters for all leaves of the record.
void optimize()
[Provisional] Optimizes the whole graph.
MemObjRecord * getMemObjRecord(SYCLMemObjI *MemObject)
EventImplPtr completeFusion(QueueImplPtr Queue, std::vector< Command * > &ToEnqueue, const property_list &)
Command * addHostAccessor(Requirement *Req, std::vector< Command * > &ToEnqueue)
Enqueues a command to create a host accessor.
void cleanupCommandsForRecord(MemObjRecord *Record)
Removes commands that use the given MemObjRecord from the graph.
void removeRecordForMemObj(SYCLMemObjI *MemObject)
Removes the MemObjRecord for the memory object passed.
Command * addCopyBack(Requirement *Req, std::vector< Command * > &ToEnqueue)
Enqueues a command to update memory to the latest state.
Command * connectDepEvent(Command *const Cmd, const EventImplPtr &DepEvent, const DepDesc &Dep, std::vector< Command * > &ToCleanUp)
Perform connection of events in multiple contexts.
GraphBuildResult addCG(std::unique_ptr< detail::CG > CommandGroup, const QueueImplPtr &Queue, std::vector< Command * > &ToEnqueue, bool EventNeeded, sycl::detail::pi::PiExtCommandBuffer CommandBuffer=nullptr, const std::vector< sycl::detail::pi::PiExtSyncPoint > &Dependencies={})
Registers command group and adds it to the dependency graph.
void cancelFusion(QueueImplPtr Queue, std::vector< Command * > &ToEnqueue)
void addNodeToLeaves(MemObjRecord *Record, Command *Cmd, access::mode AccessMode, std::vector< Command * > &ToEnqueue)
Adds new command to leaves if needed.
void rescheduleCommand(Command *Cmd, const QueueImplPtr &Queue)
Reschedules the command passed using Queue provided.
void cleanUpCmdFusion(sycl::detail::queue_impl *Queue)
Clean up the internal fusion commands held for the given queue.
AllocaCommandBase * findAllocaForReq(MemObjRecord *Record, const Requirement *Req, const ContextImplPtr &Context, bool AllowConst=true)
Searches for suitable alloca in memory record.
DepDesc findDepForRecord(Command *Cmd, MemObjRecord *Record)
Finds a command dependency corresponding to the record.
void updateLeaves(const std::set< Command * > &Cmds, MemObjRecord *Record, access::mode AccessMode, std::vector< Command * > &ToCleanUp)
Removes commands from leaves.
Graph Processor provides interfaces for enqueueing commands and their dependencies to the underlying ...
Definition: scheduler.hpp:889
static void waitForEvent(const EventImplPtr &Event, ReadLockT &GraphReadLock, std::vector< Command * > &ToCleanUp, bool LockTheLock=true, bool *Success=nullptr)
Waits for the command, associated with Event passed, is completed.
static bool enqueueCommand(Command *Cmd, ReadLockT &GraphReadLock, EnqueueResultT &EnqueueResult, std::vector< Command * > &ToCleanUp, Command *RootCommand, BlockingT Blocking=NON_BLOCKING)
Enqueues the command and all its dependencies.
static bool handleBlockingCmd(Command *Cmd, EnqueueResultT &EnqueueResult, Command *RootCommand, BlockingT Blocking)
Check if successfully enqueued command is expected to be blocking for the dependent commands before i...
DPC++ graph scheduler class.
Definition: scheduler.hpp:366
void waitForEvent(const EventImplPtr &Event, bool *Success=nullptr)
Waits for the event.
Definition: scheduler.cpp:256
ReadLockT acquireFusionReadLock()
Provides shared access to std::shared_timed_mutex object with deadlock avoidance to the Fusion map.
Definition: scheduler.hpp:548
EventImplPtr addCopyBack(Requirement *Req)
Registers a command group, that copies most recent memory to the memory pointed by the requirement.
Definition: scheduler.cpp:208
static void enqueueUnblockedCommands(const std::vector< EventImplPtr > &CmdsToEnqueue, ReadLockT &GraphReadLock, std::vector< Command * > &ToCleanUp)
Definition: scheduler.cpp:368
ReadLockT acquireReadLock()
Provides shared access to std::shared_timed_mutex object with deadlock avoidance.
Definition: scheduler.hpp:544
EventImplPtr addCG(std::unique_ptr< detail::CG > CommandGroup, const QueueImplPtr &Queue, bool EventNeeded, sycl::detail::pi::PiExtCommandBuffer CommandBuffer=nullptr, const std::vector< sycl::detail::pi::PiExtSyncPoint > &Dependencies={})
Registers a command group, and adds it to the dependency graph.
Definition: scheduler.cpp:99
EventImplPtr addHostAccessor(Requirement *Req)
Adds nodes to the graph, that update the requirement with the pointer to the host memory.
Definition: scheduler.cpp:294
std::unordered_map< EventImplPtr, std::vector< std::shared_ptr< const void > > > MAuxiliaryResources
Definition: scheduler.hpp:960
void registerAuxiliaryResources(EventImplPtr &Event, std::vector< std::shared_ptr< const void >> Resources)
Definition: scheduler.cpp:565
void cleanupAuxiliaryResources(BlockingT Blocking)
Definition: scheduler.cpp:572
std::unique_lock< RWLockT > WriteLockT
Definition: scheduler.hpp:502
sycl::detail::pi::PiKernel completeSpecConstMaterialization(QueueImplPtr Queue, const RTDeviceBinaryImage *BinImage, const std::string &KernelName, std::vector< unsigned char > &SpecConstBlob)
Definition: scheduler.cpp:610
EventImplPtr completeFusion(QueueImplPtr Queue, const property_list &)
Definition: scheduler.cpp:625
EventImplPtr addCommandGraphUpdate(ext::oneapi::experimental::detail::exec_graph_impl *Graph, std::vector< std::shared_ptr< ext::oneapi::experimental::detail::node_impl >> Nodes, const QueueImplPtr &Queue, std::vector< Requirement * > Requirements, std::vector< detail::EventImplPtr > &Events)
Adds a command buffer update operation to the execution graph.
Definition: scheduler.cpp:668
std::shared_timed_mutex RWLockT
Definition: scheduler.hpp:500
void cleanupDeferredMemObjects(BlockingT Blocking)
Definition: scheduler.cpp:493
static void enqueueLeavesOfReqUnlocked(const Requirement *const Req, ReadLockT &GraphReadLock, std::vector< Command * > &ToCleanUp)
Definition: scheduler.cpp:349
void enqueueCommandForCG(EventImplPtr NewEvent, std::vector< Command * > &AuxilaryCmds, BlockingT Blocking=NON_BLOCKING)
Definition: scheduler.cpp:151
bool isInFusionMode(QueueIdT Queue)
Definition: scheduler.cpp:639
void cancelFusion(QueueImplPtr Queue)
Definition: scheduler.cpp:600
std::shared_lock< RWLockT > ReadLockT
Definition: scheduler.hpp:501
std::vector< std::shared_ptr< SYCLMemObjI > > MDeferredMemObjRelease
Definition: scheduler.hpp:956
void startFusion(QueueImplPtr Queue)
Definition: scheduler.cpp:587
bool checkLeavesCompletion(MemObjRecord *Record)
Definition: scheduler.cpp:33
static MemObjRecord * getMemObjRecord(const Requirement *const Req)
Definition: scheduler.cpp:403
void releaseHostAccessor(Requirement *Req)
Unblocks operations with the memory object.
Definition: scheduler.cpp:333
void waitForRecordToFinish(MemObjRecord *Record, ReadLockT &GraphReadLock)
This function waits on all of the graph leaves which somehow use the memory object which is represent...
Definition: scheduler.cpp:49
static Scheduler & getInstance()
Definition: scheduler.cpp:248
void cleanUpCmdFusion(sycl::detail::queue_impl *Queue)
Definition: scheduler.cpp:593
void takeAuxiliaryResources(const EventImplPtr &Dst, const EventImplPtr &Src)
Assign Src's auxiliary resources to Dst.
Definition: scheduler.cpp:553
void cleanupCommands(const std::vector< Command * > &Cmds)
Definition: scheduler.cpp:407
void NotifyHostTaskCompletion(Command *Cmd)
Definition: scheduler.cpp:447
WriteLockT acquireWriteLock()
Provides exclusive access to std::shared_timed_mutex object with deadlock avoidance.
Definition: scheduler.hpp:506
bool removeMemoryObject(detail::SYCLMemObjI *MemObj, bool StrictLock=true)
Removes buffer from the graph.
Definition: scheduler.cpp:266
WriteLockT acquireFusionWriteLock()
Provides exclusive access to std::shared_timed_mutex object with deadlock avoidance to the Fusion map...
Definition: scheduler.hpp:525
std::vector< Command * > MDeferredCleanupCommands
Definition: scheduler.hpp:953
void deferMemObjRelease(const std::shared_ptr< detail::SYCLMemObjI > &MemObj)
Definition: scheduler.cpp:480
void releaseResources(BlockingT Blocking=BlockingT::BLOCKING)
Definition: scheduler.cpp:384
static bool areEventsSafeForSchedulerBypass(const std::vector< sycl::event > &DepEvents, ContextImplPtr Context)
Definition: scheduler.cpp:734
Class representing the implementation of command_graph<executable>.
Objects of the property_list class are containers for the SYCL properties.
Encapsulates a single SYCL queue which schedules kernels on a SYCL device.
Definition: queue.hpp:110
std::unordered_map< QueueIdT, FusionList > FusionMap
Definition: scheduler.hpp:194
std::hash< std::shared_ptr< detail::queue_impl > >::result_type QueueIdT
Definition: scheduler.hpp:191
std::shared_ptr< sycl::detail::context_impl > ContextImplPtr
Definition: event_impl.hpp:32
std::unique_ptr< KernelFusionCommand > FusionList
Definition: scheduler.hpp:193
std::shared_ptr< detail::stream_impl > StreamImplPtr
Definition: commands.hpp:52
std::shared_ptr< event_impl > EventImplPtr
Definition: handler.hpp:184
std::shared_ptr< sycl::detail::queue_impl > QueueImplPtr
Definition: helpers.hpp:46
std::unique_ptr< Command > CommandPtr
Definition: scheduler.hpp:192
class __SYCL_EBO __SYCL_SPECIAL_CLASS AccessMode
Definition: access.hpp:18
Dependency between two commands.
Definition: commands.hpp:83
Result of command enqueueing.
Definition: commands.hpp:64
Memory Object Record.
Definition: scheduler.hpp:202
MemObjRecord(ContextImplPtr Ctx, std::size_t LeafLimit, LeavesCollection::AllocateDependencyF AllocateDependency)
Definition: scheduler.hpp:203
std::vector< AllocaCommandBase * > MAllocaCommands
Definition: scheduler.hpp:208