Skip to content

Commit 918b285

Browse files
Ivan Karachunromanovvlad
authored andcommitted
[SYCL] Get rid of ForceFullReq flag
There is no more need in this flag since FullReq is always forced. Signed-off-by: Ivan Karachun <[email protected]>
1 parent 54e83ff commit 918b285

File tree

2 files changed

+11
-17
lines changed

2 files changed

+11
-17
lines changed

sycl/include/CL/sycl/detail/scheduler/scheduler.hpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,7 @@ class Scheduler {
162162
// If none found, creates new one.
163163
AllocaCommandBase *getOrCreateAllocaForReq(MemObjRecord *Record,
164164
Requirement *Req,
165-
QueueImplPtr Queue,
166-
bool ForceFullReq = false);
165+
QueueImplPtr Queue);
167166

168167
void markModifiedIfWrite(MemObjRecord *Record,
169168
Requirement *Req);

sycl/source/detail/scheduler/graph_builder.cpp

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -579,20 +579,13 @@ AllocaCommandBase *Scheduler::GraphBuilder::findAllocaForReq(
579579
// The function searches for the alloca command matching context and
580580
// requirement. If none exists, new command will be created.
581581
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) {
590583

591584
AllocaCommandBase *AllocaCmd =
592-
findAllocaForReq(Record, SearchReq, Queue->get_context_impl());
585+
findAllocaForReq(Record, Req, Queue->get_context_impl());
593586

594587
if (!AllocaCmd) {
595-
if (!ForceFullReq && IsSuitableSubReq(Req)) {
588+
if (IsSuitableSubReq(Req)) {
596589
// Get parent requirement. It's hard to get right parents' range
597590
// so full parent requirement has range represented in bytes
598591
range<3> ParentRange{Req->MSYCLMemObj->getSize(), 1, 1};
@@ -602,12 +595,16 @@ AllocaCommandBase *Scheduler::GraphBuilder::getOrCreateAllocaForReq(
602595
/*Working with bytes*/ sizeof(char));
603596

604597
auto *ParentAlloca =
605-
getOrCreateAllocaForReq(Record, &ParentRequirement, Queue, true);
598+
getOrCreateAllocaForReq(Record, &ParentRequirement, Queue);
606599
AllocaCmd = new AllocaSubBufCommand(Queue, *Req, ParentAlloca);
607600
UpdateLeafs(findDepsForReq(Record, Req, Queue), Record,
608601
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);
610606
AllocaCmd = new AllocaCommand(Queue, FullReq);
607+
}
611608

612609
Record->MAllocaCommands.push_back(AllocaCmd);
613610
Record->MWriteLeafs.push_back(AllocaCmd);
@@ -645,7 +642,6 @@ Scheduler::GraphBuilder::addCG(std::unique_ptr<detail::CG> CommandGroup,
645642

646643
for (Requirement *Req : Reqs) {
647644
MemObjRecord *Record = getOrInsertMemObjRecord(Queue, Req);
648-
bool ForceFullReq = !IsSuitableSubReq(Req);
649645
markModifiedIfWrite(Record, Req);
650646

651647
// 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,
660656
insertMemCpyCmd(Record, Req, Queue);
661657
}
662658
}
663-
AllocaCommandBase *AllocaCmd =
664-
getOrCreateAllocaForReq(Record, Req, Queue, ForceFullReq);
659+
AllocaCommandBase *AllocaCmd = getOrCreateAllocaForReq(Record, Req, Queue);
665660
std::set<Command *> Deps = findDepsForReq(Record, Req, Queue);
666661

667662
for (Command *Dep : Deps)

0 commit comments

Comments
 (0)