@@ -944,30 +944,14 @@ void Scheduler::GraphBuilder::connectDepEvent(Command *const Cmd,
944
944
945
945
// make ConnectCmd depend on requirement
946
946
{
947
- MemObjRecord *Record = getMemObjRecord (Req->MSYCLMemObj );
948
- Dep.MDepCommand ->addUser (ConnectCmd);
949
-
950
- AllocaCommandBase *AllocaCmd =
951
- findAllocaForReq (Record, Req, DepEventContext);
952
- assert (AllocaCmd && " There must be alloca for requirement!" );
953
-
954
- std::set<Command *> Deps = findDepsForReq (Record, Req, DepEventContext);
955
- assert (Deps.size () && " There must be some deps" );
956
-
957
- for (Command *ReqDepCmd : Deps) {
958
- // we don't want to depend on any host task as the only "entry point" to
959
- // host task is its empty cmd which is in Deps anyway
960
- if (ReqDepCmd->getType () == Command::CommandType::RUN_CG) {
961
- auto *Cmd = static_cast <ExecCGCommand *>(ReqDepCmd);
962
- if (Cmd->getCG ().getType () == CG::CGTYPE::CODEPLAY_HOST_TASK)
963
- continue ;
964
- }
947
+ ConnectCmd->addDep (Dep);
948
+ assert (reinterpret_cast <Command *>(DepEvent->getCommand ()) ==
949
+ Dep.MDepCommand );
950
+ // add user to Dep.MDepCommand is already performed beyond this if branch
965
951
966
- ConnectCmd->addDep (DepDesc{ReqDepCmd, Req, AllocaCmd});
967
- ReqDepCmd->addUser (ConnectCmd);
968
- }
952
+ MemObjRecord *Record = getMemObjRecord (Req->MSYCLMemObj );
969
953
970
- updateLeaves (Deps , Record, Req->MAccessMode );
954
+ updateLeaves ({ Dep. MDepCommand } , Record, Req->MAccessMode );
971
955
addNodeToLeaves (Record, ConnectCmd, Req->MAccessMode );
972
956
}
973
957
0 commit comments