File tree Expand file tree Collapse file tree 1 file changed +4
-21
lines changed
sycl/source/detail/scheduler Expand file tree Collapse file tree 1 file changed +4
-21
lines changed Original file line number Diff line number Diff line change @@ -63,30 +63,13 @@ bool Scheduler::GraphProcessor::enqueueCommand(Command *Cmd,
63
63
return false ;
64
64
}
65
65
66
- // Indicates whether dependency cannot be enqueued
67
- bool BlockedByDep = false ;
68
-
66
+ // Recursively enqueue all the dependencies first and
67
+ // exit immediately if any of the commands cannot be enqueued.
69
68
for (DepDesc &Dep : Cmd->MDeps ) {
70
- const bool Enqueued =
71
- enqueueCommand (Dep.MDepCommand , EnqueueResult, Blocking);
72
- if (!Enqueued)
73
- switch (EnqueueResult.MResult ) {
74
- case EnqueueResultT::SyclEnqueueFailed:
75
- default :
76
- // Exit immediately if a command fails to avoid enqueueing commands
77
- // result of which will be discarded.
78
- return false ;
79
- case EnqueueResultT::SyclEnqueueBlocked:
80
- // If some dependency is blocked do not enqueue other deps.
81
- return false ;
82
- }
69
+ if (!enqueueCommand (Dep.MDepCommand , EnqueueResult, Blocking))
70
+ return false ;
83
71
}
84
72
85
- // Exit if some command is blocked from enqueueing, the EnqueueResult is set
86
- // by the latest dependency which was blocked.
87
- if (BlockedByDep)
88
- return false ;
89
-
90
73
return Cmd->enqueue (EnqueueResult, Blocking);
91
74
}
92
75
You can’t perform that action at this time.
0 commit comments