@@ -579,20 +579,13 @@ AllocaCommandBase *Scheduler::GraphBuilder::findAllocaForReq(
579
579
// The function searches for the alloca command matching context and
580
580
// requirement. If none exists, new command will be created.
581
581
AllocaCommandBase *Scheduler::GraphBuilder::getOrCreateAllocaForReq (
582
- MemObjRecord *Record, Requirement *Req, QueueImplPtr Queue,
583
- bool ForceFullReq) {
584
-
585
- Requirement FullReq (/* Offset*/ {0 , 0 , 0 }, Req->MMemoryRange ,
586
- Req->MMemoryRange , access::mode::read_write,
587
- Req->MSYCLMemObj , Req->MDims , Req->MElemSize );
588
-
589
- Requirement *SearchReq = ForceFullReq ? &FullReq : Req;
582
+ MemObjRecord *Record, Requirement *Req, QueueImplPtr Queue) {
590
583
591
584
AllocaCommandBase *AllocaCmd =
592
- findAllocaForReq (Record, SearchReq , Queue->get_context_impl ());
585
+ findAllocaForReq (Record, Req , Queue->get_context_impl ());
593
586
594
587
if (!AllocaCmd) {
595
- if (!ForceFullReq && IsSuitableSubReq (Req)) {
588
+ if (IsSuitableSubReq (Req)) {
596
589
// Get parent requirement. It's hard to get right parents' range
597
590
// so full parent requirement has range represented in bytes
598
591
range<3 > ParentRange{Req->MSYCLMemObj ->getSize (), 1 , 1 };
@@ -602,12 +595,16 @@ AllocaCommandBase *Scheduler::GraphBuilder::getOrCreateAllocaForReq(
602
595
/* Working with bytes*/ sizeof (char ));
603
596
604
597
auto *ParentAlloca =
605
- getOrCreateAllocaForReq (Record, &ParentRequirement, Queue, true );
598
+ getOrCreateAllocaForReq (Record, &ParentRequirement, Queue);
606
599
AllocaCmd = new AllocaSubBufCommand (Queue, *Req, ParentAlloca);
607
600
UpdateLeafs (findDepsForReq (Record, Req, Queue), Record,
608
601
access::mode::read_write);
609
- } else
602
+ } else {
603
+ Requirement FullReq (/* Offset*/ {0 , 0 , 0 }, Req->MMemoryRange ,
604
+ Req->MMemoryRange , access::mode::read_write,
605
+ Req->MSYCLMemObj , Req->MDims , Req->MElemSize );
610
606
AllocaCmd = new AllocaCommand (Queue, FullReq);
607
+ }
611
608
612
609
Record->MAllocaCommands .push_back (AllocaCmd);
613
610
Record->MWriteLeafs .push_back (AllocaCmd);
@@ -645,7 +642,6 @@ Scheduler::GraphBuilder::addCG(std::unique_ptr<detail::CG> CommandGroup,
645
642
646
643
for (Requirement *Req : Reqs) {
647
644
MemObjRecord *Record = getOrInsertMemObjRecord (Queue, Req);
648
- bool ForceFullReq = !IsSuitableSubReq (Req);
649
645
markModifiedIfWrite (Record, Req);
650
646
651
647
// If there is alloca command we need to check if the latest memory is in
@@ -660,8 +656,7 @@ Scheduler::GraphBuilder::addCG(std::unique_ptr<detail::CG> CommandGroup,
660
656
insertMemCpyCmd (Record, Req, Queue);
661
657
}
662
658
}
663
- AllocaCommandBase *AllocaCmd =
664
- getOrCreateAllocaForReq (Record, Req, Queue, ForceFullReq);
659
+ AllocaCommandBase *AllocaCmd = getOrCreateAllocaForReq (Record, Req, Queue);
665
660
std::set<Command *> Deps = findDepsForReq (Record, Req, Queue);
666
661
667
662
for (Command *Dep : Deps)
0 commit comments