File tree Expand file tree Collapse file tree 2 files changed +36
-1
lines changed
include/CL/sycl/detail/scheduler Expand file tree Collapse file tree 2 files changed +36
-1
lines changed Original file line number Diff line number Diff line change @@ -66,7 +66,8 @@ class Command {
66
66
RELEASE,
67
67
MAP_MEM_OBJ,
68
68
UNMAP_MEM_OBJ,
69
- UPDATE_REQUIREMENT
69
+ UPDATE_REQUIREMENT,
70
+ EMPTY_TASK
70
71
};
71
72
72
73
Command (CommandType Type, QueueImplPtr Queue, bool UseExclusiveQueue = false );
@@ -123,6 +124,23 @@ class Command {
123
124
std::atomic<bool > MEnqueued;
124
125
};
125
126
127
+ // The command does nothing during enqueue. The task can be used to implement
128
+ // lock in the graph, or to merge several nodes into one.
129
+ class EmptyCommand : public Command {
130
+ public:
131
+ EmptyCommand (QueueImplPtr Queue, Requirement *Req)
132
+ : Command(CommandType::EMPTY_TASK, std::move(Queue)),
133
+ MStoredRequirement (*Req) {}
134
+
135
+ Requirement *getStoredRequirement () { return &MStoredRequirement; }
136
+
137
+ private:
138
+ cl_int enqueueImp () override { return CL_SUCCESS; }
139
+ void printDot (std::ostream &Stream) const override ;
140
+
141
+ Requirement MStoredRequirement;
142
+ };
143
+
126
144
// The command enqueues release instance of memory allocated on Host or
127
145
// underlying framework.
128
146
class ReleaseCommand : public Command {
Original file line number Diff line number Diff line change @@ -467,6 +467,23 @@ cl_int MemCpyCommandHost::enqueueImp() {
467
467
return CL_SUCCESS;
468
468
}
469
469
470
+ void EmptyCommand::printDot (std::ostream &Stream) const {
471
+ Stream << " \" " << this << " \" [style=filled, fillcolor=\" #8d8f29\" , label=\" " ;
472
+
473
+ Stream << " ID = " << this << " \n " ;
474
+ Stream << " EMPTY NODE"
475
+ << " \\ n" ;
476
+
477
+ Stream << " \" ];" << std::endl;
478
+
479
+ for (const auto &Dep : MDeps) {
480
+ Stream << " \" " << this << " \" -> \" " << Dep.MDepCommand << " \" "
481
+ << " [ label = \" Access mode: "
482
+ << accessModeToString (Dep.MReq ->MAccessMode ) << " \\ n"
483
+ << " MemObj: " << Dep.MReq ->MSYCLMemObj << " \" ]" << std::endl;
484
+ }
485
+ }
486
+
470
487
void MemCpyCommandHost::printDot (std::ostream &Stream) const {
471
488
Stream << " \" " << this << " \" [style=filled, fillcolor=\" #B6A2EB\" , label=\" " ;
472
489
You can’t perform that action at this time.
0 commit comments