20 #include <shared_mutex>
21 #include <unordered_map>
22 #include <unordered_set>
181 class DispatchHostTask;
183 using QueueImplPtr = std::shared_ptr<detail::queue_impl>;
184 using EventImplPtr = std::shared_ptr<detail::event_impl>;
196 : MReadLeaves{
this, LeafLimit, AllocateDependency},
197 MWriteLeaves{
this, LeafLimit, AllocateDependency}, MCurContext{Ctx} {}
217 bool MMemModified =
false;
366 EventImplPtr addCG(std::unique_ptr<detail::CG> CommandGroup,
407 void cleanupFinishedCommands(
EventImplPtr FinishedEvent);
435 void allocateStreamBuffers(
stream_impl *,
size_t,
size_t);
462 void cleanupCommands(
const std::vector<Command *> &Cmds);
464 static void enqueueLeavesOfReqUnlocked(
const Requirement *
const Req,
465 std::vector<Command *> &ToCleanUp);
483 std::vector<Command *> &ToEnqueue);
489 Command *addCGUpdateHost(std::unique_ptr<detail::CG> CommandGroup,
491 std::vector<Command *> &ToEnqueue);
502 std::vector<Command *> &ToEnqueue);
511 void cleanupCommand(
Command *Cmd);
515 void cleanupFinishedCommands(
517 std::vector<std::shared_ptr<cl::sycl::detail::stream_impl>> &,
518 std::vector<std::shared_ptr<const void>> &);
536 std::vector<Command *> &ToEnqueue);
539 void decrementLeafCountersForRecord(
MemObjRecord *Record);
542 void cleanupCommandsForRecord(
544 std::vector<std::shared_ptr<cl::sycl::detail::stream_impl>> &,
545 std::vector<std::shared_ptr<const void>> &);
548 void removeRecordForMemObj(
SYCLMemObjI *MemObject);
553 std::vector<Command *> &ToEnqueue);
556 void updateLeaves(
const std::set<Command *> &Cmds,
MemObjRecord *Record,
558 std::vector<Command *> &ToCleanUp);
571 std::vector<Command *> &ToCleanUp);
587 std::vector<Command *> &ToEnqueue);
593 std::vector<Command *> &ToEnqueue);
598 std::vector<Command *> &ToEnqueue);
601 std::set<Command *> findDepsForReq(
MemObjRecord *Record,
605 template <
typename T>
607 std::is_same<typename std::remove_cv_t<T>,
Requirement>::value,
609 addEmptyCmd(
Command *Cmd,
const std::vector<T *> &Req,
611 std::vector<Command *> &ToEnqueue,
612 const bool AddDepsToLeaves =
true);
626 friend class ::MockScheduler;
634 std::vector<Command *> &ToEnqueue);
639 std::queue<Command *> MCmdsToVisit;
641 std::vector<Command *> MVisitedCmds;
646 void printGraphAsDot(
const char *ModeName);
656 std::array<bool, PrintOptions::Size> MPrintOptionsArray{
false};
741 std::vector<Command *> &ToCleanUp,
742 bool LockTheLock =
true);
753 std::vector<Command *> &ToCleanUp,
789 : Data(StreamBufferSize, 0),
790 Buf(Data.data(),
range<1>(StreamBufferSize),
792 FlushBuf(
range<1>(FlushBufferSize)) {
795 Buf.set_write_back(
false);
796 FlushBuf.set_write_back(
false);