Skip to content

Commit 7e1a82f

Browse files
author
Alexander Batashev
committed
Resolve comments
Signed-off-by: Alexander Batashev <[email protected]>
1 parent 7d81ce4 commit 7e1a82f

File tree

3 files changed

+23
-23
lines changed

3 files changed

+23
-23
lines changed

sycl/include/CL/sycl/detail/queue_impl.hpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ class queue_impl {
115115
}
116116

117117
/// @return a pointer to a context_impl.
118-
ContextImplPtr get_context_impl() const { return MContext; }
118+
ContextImplPtr getContextImpl() const { return MContext; }
119119

120120
/// @return an associated SYCL device.
121121
device get_device() const { return createSyclObjFromImpl<device>(MDevice); }
@@ -146,7 +146,7 @@ class queue_impl {
146146
return submit_impl(CGF, Self);
147147
} catch (...) {
148148
{
149-
std::lock_guard<mutex_class> guard(MMutex);
149+
std::lock_guard<mutex_class> Guard(MMutex);
150150
MExceptions.PushBack(std::current_exception());
151151
}
152152
return SecondQueue->submit(CGF, SecondQueue);
@@ -169,7 +169,7 @@ class queue_impl {
169169
///
170170
/// Synchronous errors will be reported through SYCL exceptions.
171171
void wait() {
172-
std::lock_guard<mutex_class> guard(MMutex);
172+
std::lock_guard<mutex_class> Guard(MMutex);
173173
for (auto &Event : MEvents)
174174
Event.wait();
175175
MEvents.clear();
@@ -242,7 +242,7 @@ class queue_impl {
242242
/// @return a raw PI handle for a free queue. The returned handle is not
243243
/// retained. It is caller responsibility to make sure queue is still alive.
244244
RT::PiQueue &getExclusiveQueueHandleRef() {
245-
std::lock_guard<mutex_class> guard(MMutex);
245+
std::lock_guard<mutex_class> Guard(MMutex);
246246

247247
// To achieve parallelism for FPGA with in order execution model with
248248
// possibility of two kernels to share data with each other we shall
@@ -271,7 +271,7 @@ class queue_impl {
271271
{
272272
// Reduce the scope since this mutex is also
273273
// locked inside of getExclusiveQueueHandleRef()
274-
std::lock_guard<mutex_class> guard(MMutex);
274+
std::lock_guard<mutex_class> Guard(MMutex);
275275

276276
if (MQueues.empty()) {
277277
MQueues.push_back(MCommandQueue);
@@ -325,7 +325,7 @@ class queue_impl {
325325
///
326326
/// @param ExceptionPtr is a pointer to exception to be put.
327327
void reportAsyncException(std::exception_ptr ExceptionPtr) {
328-
std::lock_guard<mutex_class> guard(MMutex);
328+
std::lock_guard<mutex_class> Guard(MMutex);
329329
MExceptions.PushBack(ExceptionPtr);
330330
}
331331

@@ -341,7 +341,7 @@ class queue_impl {
341341
CGF(Handler);
342342
event Event = Handler.finalize();
343343
{
344-
std::lock_guard<mutex_class> guard(MMutex);
344+
std::lock_guard<mutex_class> Guard(MMutex);
345345
MEvents.push_back(Event);
346346
}
347347
return Event;

sycl/include/CL/sycl/queue.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ class queue {
227227
/// @param Ptr is a USM pointer to the memory to be prefetched to the device.
228228
/// @param Count is a number of bytes to be prefetched.
229229
event prefetch(const void* Ptr, size_t Count) {
230-
return submit([=](handler &cgh) { cgh.prefetch(Ptr, Count); });
230+
return submit([=](handler &CGH) { CGH.prefetch(Ptr, Count); });
231231
}
232232

233233
/// single_task version with a kernel represented as a lambda.

sycl/source/detail/scheduler/graph_builder.cpp

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ Scheduler::GraphBuilder::getOrInsertMemObjRecord(const QueueImplPtr &Queue,
123123
MemObject->MRecord.reset(new MemObjRecord{/*MAllocaCommands*/ {},
124124
/*MReadLeaves*/ {},
125125
/*MWriteLeaves*/ {},
126-
Queue->get_context_impl(),
126+
Queue->getContextImpl(),
127127
/*MMemModified*/ false});
128128

129129
MMemObjs.push_back(MemObject);
@@ -162,7 +162,7 @@ void Scheduler::GraphBuilder::AddNodeToLeaves(MemObjRecord *Record,
162162
UpdateHostRequirementCommand *Scheduler::GraphBuilder::insertUpdateHostReqCmd(
163163
MemObjRecord *Record, Requirement *Req, const QueueImplPtr &Queue) {
164164
AllocaCommandBase *AllocaCmd =
165-
findAllocaForReq(Record, Req, Queue->get_context_impl());
165+
findAllocaForReq(Record, Req, Queue->getContextImpl());
166166
assert(AllocaCmd && "There must be alloca for requirement!");
167167
UpdateHostRequirementCommand *UpdateCommand =
168168
new UpdateHostRequirementCommand(Queue, *Req, AllocaCmd, &Req->MData);
@@ -171,7 +171,7 @@ UpdateHostRequirementCommand *Scheduler::GraphBuilder::insertUpdateHostReqCmd(
171171
const Requirement *StoredReq = UpdateCommand->getRequirement();
172172

173173
std::set<Command *> Deps =
174-
findDepsForReq(Record, Req, Queue->get_context_impl());
174+
findDepsForReq(Record, Req, Queue->getContextImpl());
175175
for (Command *Dep : Deps) {
176176
UpdateCommand->addDep(DepDesc{Dep, StoredReq, AllocaCmd});
177177
Dep->addUser(UpdateCommand);
@@ -218,7 +218,7 @@ Command *Scheduler::GraphBuilder::insertMemoryMove(MemObjRecord *Record,
218218
throw runtime_error("Out of host memory");
219219

220220
std::set<Command *> Deps =
221-
findDepsForReq(Record, Req, Queue->get_context_impl());
221+
findDepsForReq(Record, Req, Queue->getContextImpl());
222222
Deps.insert(AllocaCmdDst);
223223
// Get parent allocation of sub buffer to perform full copy of whole buffer
224224
if (IsSuitableSubReq(Req)) {
@@ -237,7 +237,7 @@ Command *Scheduler::GraphBuilder::insertMemoryMove(MemObjRecord *Record,
237237
// current context, need to find a parent alloca command for it (it must be
238238
// there)
239239
auto IsSuitableAlloca = [Record, Req](AllocaCommandBase *AllocaCmd) {
240-
bool Res = sameCtx(AllocaCmd->getQueue()->get_context_impl(),
240+
bool Res = sameCtx(AllocaCmd->getQueue()->getContextImpl(),
241241
Record->MCurContext) &&
242242
// Looking for a parent buffer alloca command
243243
AllocaCmd->getType() == Command::CommandType::ALLOCA;
@@ -279,7 +279,7 @@ Command *Scheduler::GraphBuilder::insertMemoryMove(MemObjRecord *Record,
279279
}
280280
UpdateLeaves(Deps, Record, access::mode::read_write);
281281
AddNodeToLeaves(Record, NewCmd, access::mode::read_write);
282-
Record->MCurContext = Queue->get_context_impl();
282+
Record->MCurContext = Queue->getContextImpl();
283283
return NewCmd;
284284
}
285285

@@ -298,7 +298,7 @@ Command *Scheduler::GraphBuilder::addCopyBack(Requirement *Req) {
298298
return nullptr;
299299

300300
std::set<Command *> Deps =
301-
findDepsForReq(Record, Req, HostQueue->get_context_impl());
301+
findDepsForReq(Record, Req, HostQueue->getContextImpl());
302302
AllocaCommandBase *SrcAllocaCmd =
303303
findAllocaForReq(Record, Req, Record->MCurContext);
304304

@@ -336,7 +336,7 @@ Command *Scheduler::GraphBuilder::addHostAccessor(Requirement *Req) {
336336
AllocaCommandBase *HostAllocaCmd =
337337
getOrCreateAllocaForReq(Record, Req, HostQueue);
338338

339-
if (!sameCtx(HostAllocaCmd->getQueue()->get_context_impl(),
339+
if (!sameCtx(HostAllocaCmd->getQueue()->getContextImpl(),
340340
Record->MCurContext))
341341
insertMemoryMove(Record, Req, HostQueue);
342342

@@ -418,7 +418,7 @@ Scheduler::GraphBuilder::findDepsForReq(MemObjRecord *Record, Requirement *Req,
418418
// Going through copying memory between contexts is not supported.
419419
if (Dep.MDepCommand)
420420
CanBypassDep &=
421-
sameCtx(Context, Dep.MDepCommand->getQueue()->get_context_impl());
421+
sameCtx(Context, Dep.MDepCommand->getQueue()->getContextImpl());
422422

423423
if (!CanBypassDep) {
424424
RetDeps.insert(DepCmd);
@@ -441,7 +441,7 @@ Scheduler::GraphBuilder::findDepsForReq(MemObjRecord *Record, Requirement *Req,
441441
AllocaCommandBase *Scheduler::GraphBuilder::findAllocaForReq(
442442
MemObjRecord *Record, Requirement *Req, const ContextImplPtr &Context) {
443443
auto IsSuitableAlloca = [&Context, Req](AllocaCommandBase *AllocaCmd) {
444-
bool Res = sameCtx(AllocaCmd->getQueue()->get_context_impl(), Context);
444+
bool Res = sameCtx(AllocaCmd->getQueue()->getContextImpl(), Context);
445445
if (IsSuitableSubReq(Req)) {
446446
const Requirement *TmpReq = AllocaCmd->getRequirement();
447447
Res &= TmpReq->MOffsetInBytes == Req->MOffsetInBytes;
@@ -462,7 +462,7 @@ AllocaCommandBase *Scheduler::GraphBuilder::getOrCreateAllocaForReq(
462462
MemObjRecord *Record, Requirement *Req, QueueImplPtr Queue) {
463463

464464
AllocaCommandBase *AllocaCmd =
465-
findAllocaForReq(Record, Req, Queue->get_context_impl());
465+
findAllocaForReq(Record, Req, Queue->getContextImpl());
466466

467467
if (!AllocaCmd) {
468468
if (IsSuitableSubReq(Req)) {
@@ -477,7 +477,7 @@ AllocaCommandBase *Scheduler::GraphBuilder::getOrCreateAllocaForReq(
477477
auto *ParentAlloca =
478478
getOrCreateAllocaForReq(Record, &ParentRequirement, Queue);
479479
AllocaCmd = new AllocaSubBufCommand(Queue, *Req, ParentAlloca);
480-
UpdateLeaves(findDepsForReq(Record, Req, Queue->get_context_impl()),
480+
UpdateLeaves(findDepsForReq(Record, Req, Queue->getContextImpl()),
481481
Record, access::mode::read_write);
482482
} else {
483483

@@ -530,7 +530,7 @@ AllocaCommandBase *Scheduler::GraphBuilder::getOrCreateAllocaForReq(
530530
AllocaCmd->MIsActive = false;
531531
} else {
532532
LinkedAllocaCmd->MIsActive = false;
533-
Record->MCurContext = Queue->get_context_impl();
533+
Record->MCurContext = Queue->getContextImpl();
534534
}
535535
}
536536
}
@@ -576,7 +576,7 @@ Scheduler::GraphBuilder::addCG(std::unique_ptr<detail::CG> CommandGroup,
576576
AllocaCommandBase *AllocaCmd = getOrCreateAllocaForReq(Record, Req, Queue);
577577
// If there is alloca command we need to check if the latest memory is in
578578
// required context.
579-
if (!sameCtx(Queue->get_context_impl(), Record->MCurContext)) {
579+
if (!sameCtx(Queue->getContextImpl(), Record->MCurContext)) {
580580
// Cannot directly copy memory from OpenCL device to OpenCL device -
581581
// create two copies: device->host and host->device.
582582
if (!Queue->is_host() && !Record->MCurContext->is_host())
@@ -585,7 +585,7 @@ Scheduler::GraphBuilder::addCG(std::unique_ptr<detail::CG> CommandGroup,
585585
insertMemoryMove(Record, Req, Queue);
586586
}
587587
std::set<Command *> Deps =
588-
findDepsForReq(Record, Req, Queue->get_context_impl());
588+
findDepsForReq(Record, Req, Queue->getContextImpl());
589589

590590
for (Command *Dep : Deps)
591591
NewCmd->addDep(DepDesc{Dep, Req, AllocaCmd});

0 commit comments

Comments
 (0)