From f46f79d579ed031c579df75cfef5081596b2da4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tadej=20Ciglari=C4=8D?= Date: Tue, 5 Jul 2022 15:19:07 +0100 Subject: [PATCH 1/6] alternative solution to optimize memory transfers --- sycl/include/CL/sycl/detail/sycl_mem_obj_t.hpp | 4 ++++ sycl/source/detail/memory_manager.cpp | 9 ++------- sycl/source/detail/scheduler/commands.cpp | 8 ++++---- sycl/source/detail/scheduler/commands.hpp | 8 ++++++-- sycl/source/detail/scheduler/graph_builder.cpp | 12 +++++++----- sycl/source/detail/scheduler/scheduler.hpp | 3 ++- 6 files changed, 25 insertions(+), 19 deletions(-) diff --git a/sycl/include/CL/sycl/detail/sycl_mem_obj_t.hpp b/sycl/include/CL/sycl/detail/sycl_mem_obj_t.hpp index 10b4e415fd087..bb2217c60a1db 100644 --- a/sycl/include/CL/sycl/detail/sycl_mem_obj_t.hpp +++ b/sycl/include/CL/sycl/detail/sycl_mem_obj_t.hpp @@ -314,6 +314,10 @@ class __SYCL_EXPORT SYCLMemObjT : public SYCLMemObjI { bool isInterop() const; + bool isHostPointerReadOnly() const{ + return MHostPtrReadOnly; + } + protected: // An allocateMem helper that determines which host ptr to use void determineHostPtr(const ContextImplPtr &Context, bool InitFromUserData, diff --git a/sycl/source/detail/memory_manager.cpp b/sycl/source/detail/memory_manager.cpp index ece95985dd095..336545c5a58c6 100644 --- a/sycl/source/detail/memory_manager.cpp +++ b/sycl/source/detail/memory_manager.cpp @@ -296,14 +296,10 @@ void *MemoryManager::allocateHostMemory(SYCLMemObjI *MemObj, void *UserPtr, bool HostPtrReadOnly, size_t Size, const sycl::property_list &) { // Can return user pointer directly if it points to writable memory. - if (UserPtr && HostPtrReadOnly == false) + if (UserPtr) return UserPtr; void *NewMem = MemObj->allocateHostMem(); - // Need to initialize new memory if user provides pointer to read only - // memory. - if (UserPtr && HostPtrReadOnly == true) - std::memcpy((char *)NewMem, (char *)UserPtr, Size); return NewMem; } @@ -331,8 +327,7 @@ static RT::PiMemFlags getMemObjCreationFlags(void *UserPtr, RT::PiMemFlags Result = HostPtrReadOnly ? PI_MEM_ACCESS_READ_ONLY : PI_MEM_FLAGS_ACCESS_RW; if (UserPtr) - Result |= HostPtrReadOnly ? PI_MEM_FLAGS_HOST_PTR_COPY - : PI_MEM_FLAGS_HOST_PTR_USE; + Result |= PI_MEM_FLAGS_HOST_PTR_USE; return Result; } diff --git a/sycl/source/detail/scheduler/commands.cpp b/sycl/source/detail/scheduler/commands.cpp index e8ac4a895fafd..fada59687639d 100644 --- a/sycl/source/detail/scheduler/commands.cpp +++ b/sycl/source/detail/scheduler/commands.cpp @@ -833,10 +833,10 @@ const char *Command::getBlockReason() const { AllocaCommandBase::AllocaCommandBase(CommandType Type, QueueImplPtr Queue, Requirement Req, - AllocaCommandBase *LinkedAllocaCmd) + AllocaCommandBase *LinkedAllocaCmd, bool IsConst) : Command(Type, Queue), MLinkedAllocaCmd(LinkedAllocaCmd), MIsLeaderAlloca(nullptr == LinkedAllocaCmd), MRequirement(std::move(Req)), - MReleaseCmd(Queue, this) { + MReleaseCmd(Queue, this), MIsConst(IsConst) { MRequirement.MAccessMode = access::mode::read_write; emitInstrumentationDataProxy(); } @@ -868,9 +868,9 @@ bool AllocaCommandBase::supportsPostEnqueueCleanup() const { return false; } AllocaCommand::AllocaCommand(QueueImplPtr Queue, Requirement Req, bool InitFromUserData, - AllocaCommandBase *LinkedAllocaCmd) + AllocaCommandBase *LinkedAllocaCmd, bool IsConst) : AllocaCommandBase(CommandType::ALLOCA, std::move(Queue), std::move(Req), - LinkedAllocaCmd), + LinkedAllocaCmd, IsConst), MInitFromUserData(InitFromUserData) { // Node event must be created before the dependent edge is added to this node, // so this call must be before the addDep() call. diff --git a/sycl/source/detail/scheduler/commands.hpp b/sycl/source/detail/scheduler/commands.hpp index 0a0dfa8badf61..56caf4826fc95 100644 --- a/sycl/source/detail/scheduler/commands.hpp +++ b/sycl/source/detail/scheduler/commands.hpp @@ -364,7 +364,8 @@ class ReleaseCommand : public Command { class AllocaCommandBase : public Command { public: AllocaCommandBase(CommandType Type, QueueImplPtr Queue, Requirement Req, - AllocaCommandBase *LinkedAllocaCmd); + AllocaCommandBase *LinkedAllocaCmd, + bool IsConst = false); ReleaseCommand *getReleaseCmd() { return &MReleaseCmd; } @@ -394,6 +395,8 @@ class AllocaCommandBase : public Command { /// Indicates that the command owns memory allocation in case of connected /// alloca command. bool MIsLeaderAlloca = true; + // Indicates tha thte data in this allocation must not be modified + bool MIsConst = false; protected: Requirement MRequirement; @@ -406,7 +409,8 @@ class AllocaCommand : public AllocaCommandBase { public: AllocaCommand(QueueImplPtr Queue, Requirement Req, bool InitFromUserData = true, - AllocaCommandBase *LinkedAllocaCmd = nullptr); + AllocaCommandBase *LinkedAllocaCmd = nullptr, + bool IsConst = false); void *getMemAllocation() const final { return MMemAllocation; } void printDot(std::ostream &Stream) const final; diff --git a/sycl/source/detail/scheduler/graph_builder.cpp b/sycl/source/detail/scheduler/graph_builder.cpp index 31edb0bd31e97..4f6330e10c1fa 100644 --- a/sycl/source/detail/scheduler/graph_builder.cpp +++ b/sycl/source/detail/scheduler/graph_builder.cpp @@ -630,14 +630,16 @@ DepDesc Scheduler::GraphBuilder::findDepForRecord(Command *Cmd, AllocaCommandBase * Scheduler::GraphBuilder::findAllocaForReq(MemObjRecord *Record, const Requirement *Req, - const ContextImplPtr &Context) { - auto IsSuitableAlloca = [&Context, Req](AllocaCommandBase *AllocaCmd) { + const ContextImplPtr &Context, + bool allowConst) { + auto IsSuitableAlloca = [&Context, Req, allowConst](AllocaCommandBase *AllocaCmd) { bool Res = sameCtx(AllocaCmd->getQueue()->getContextImplPtr(), Context); if (IsSuitableSubReq(Req)) { const Requirement *TmpReq = AllocaCmd->getRequirement(); Res &= AllocaCmd->getType() == Command::CommandType::ALLOCA_SUB_BUF; Res &= TmpReq->MOffsetInBytes == Req->MOffsetInBytes; Res &= TmpReq->MSYCLMemObj->getSize() == Req->MSYCLMemObj->getSize(); + Res &= allowConst || !AllocaCmd->MIsConst; } return Res; }; @@ -669,7 +671,7 @@ AllocaCommandBase *Scheduler::GraphBuilder::getOrCreateAllocaForReq( std::vector &ToEnqueue) { AllocaCommandBase *AllocaCmd = - findAllocaForReq(Record, Req, Queue->getContextImplPtr()); + findAllocaForReq(Record, Req, Queue->getContextImplPtr(), false); if (!AllocaCmd) { std::vector ToCleanUp; @@ -722,7 +724,7 @@ AllocaCommandBase *Scheduler::GraphBuilder::getOrCreateAllocaForReq( Scheduler::getInstance().getDefaultHostQueue(); AllocaCommand *HostAllocaCmd = new AllocaCommand( DefaultHostQueue, FullReq, true /* InitFromUserData */, - nullptr /* LinkedAllocaCmd */); + nullptr /* LinkedAllocaCmd */, MemObj->isHostPointerReadOnly() /* IsConst */); Record->MAllocaCommands.push_back(HostAllocaCmd); Record->MWriteLeaves.push_back(HostAllocaCmd, ToEnqueue); ++(HostAllocaCmd->MLeafCounter); @@ -755,7 +757,7 @@ AllocaCommandBase *Scheduler::GraphBuilder::getOrCreateAllocaForReq( : HostUnifiedMemory; if (PinnedHostMemory || HostUnifiedMemoryOnNonHostDevice) { AllocaCommandBase *LinkedAllocaCmdCand = - findAllocaForReq(Record, Req, Record->MCurContext); + findAllocaForReq(Record, Req, Record->MCurContext, false); // Cannot setup link if candidate is linked already if (LinkedAllocaCmdCand && diff --git a/sycl/source/detail/scheduler/scheduler.hpp b/sycl/source/detail/scheduler/scheduler.hpp index 39075dbcd2703..ce4882d9a993c 100644 --- a/sycl/source/detail/scheduler/scheduler.hpp +++ b/sycl/source/detail/scheduler/scheduler.hpp @@ -618,7 +618,8 @@ class Scheduler { /// Searches for suitable alloca in memory record. AllocaCommandBase *findAllocaForReq(MemObjRecord *Record, const Requirement *Req, - const ContextImplPtr &Context); + const ContextImplPtr &Context, + bool allowConst = true); friend class Command; From 2b8ea00613e82aa0cd79655248889a103749096d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tadej=20Ciglari=C4=8D?= Date: Tue, 5 Jul 2022 15:47:05 +0100 Subject: [PATCH 2/6] format --- sycl/include/CL/sycl/detail/sycl_mem_obj_t.hpp | 4 +--- sycl/source/detail/scheduler/commands.cpp | 5 +++-- sycl/source/detail/scheduler/commands.hpp | 3 +-- sycl/source/detail/scheduler/graph_builder.cpp | 14 +++++++------- 4 files changed, 12 insertions(+), 14 deletions(-) diff --git a/sycl/include/CL/sycl/detail/sycl_mem_obj_t.hpp b/sycl/include/CL/sycl/detail/sycl_mem_obj_t.hpp index bb2217c60a1db..c4f9f67e2c985 100644 --- a/sycl/include/CL/sycl/detail/sycl_mem_obj_t.hpp +++ b/sycl/include/CL/sycl/detail/sycl_mem_obj_t.hpp @@ -314,9 +314,7 @@ class __SYCL_EXPORT SYCLMemObjT : public SYCLMemObjI { bool isInterop() const; - bool isHostPointerReadOnly() const{ - return MHostPtrReadOnly; - } + bool isHostPointerReadOnly() const { return MHostPtrReadOnly; } protected: // An allocateMem helper that determines which host ptr to use diff --git a/sycl/source/detail/scheduler/commands.cpp b/sycl/source/detail/scheduler/commands.cpp index fada59687639d..591f73478a3f3 100644 --- a/sycl/source/detail/scheduler/commands.cpp +++ b/sycl/source/detail/scheduler/commands.cpp @@ -833,10 +833,11 @@ const char *Command::getBlockReason() const { AllocaCommandBase::AllocaCommandBase(CommandType Type, QueueImplPtr Queue, Requirement Req, - AllocaCommandBase *LinkedAllocaCmd, bool IsConst) + AllocaCommandBase *LinkedAllocaCmd, + bool IsConst) : Command(Type, Queue), MLinkedAllocaCmd(LinkedAllocaCmd), MIsLeaderAlloca(nullptr == LinkedAllocaCmd), MRequirement(std::move(Req)), - MReleaseCmd(Queue, this), MIsConst(IsConst) { + MReleaseCmd(Queue, this), MIsConst(IsConst) { MRequirement.MAccessMode = access::mode::read_write; emitInstrumentationDataProxy(); } diff --git a/sycl/source/detail/scheduler/commands.hpp b/sycl/source/detail/scheduler/commands.hpp index 56caf4826fc95..f7808b6e4e2e2 100644 --- a/sycl/source/detail/scheduler/commands.hpp +++ b/sycl/source/detail/scheduler/commands.hpp @@ -364,8 +364,7 @@ class ReleaseCommand : public Command { class AllocaCommandBase : public Command { public: AllocaCommandBase(CommandType Type, QueueImplPtr Queue, Requirement Req, - AllocaCommandBase *LinkedAllocaCmd, - bool IsConst = false); + AllocaCommandBase *LinkedAllocaCmd, bool IsConst = false); ReleaseCommand *getReleaseCmd() { return &MReleaseCmd; } diff --git a/sycl/source/detail/scheduler/graph_builder.cpp b/sycl/source/detail/scheduler/graph_builder.cpp index 4f6330e10c1fa..f558f6f59615f 100644 --- a/sycl/source/detail/scheduler/graph_builder.cpp +++ b/sycl/source/detail/scheduler/graph_builder.cpp @@ -627,12 +627,11 @@ DepDesc Scheduler::GraphBuilder::findDepForRecord(Command *Cmd, // The function searches for the alloca command matching context and // requirement. -AllocaCommandBase * -Scheduler::GraphBuilder::findAllocaForReq(MemObjRecord *Record, - const Requirement *Req, - const ContextImplPtr &Context, - bool allowConst) { - auto IsSuitableAlloca = [&Context, Req, allowConst](AllocaCommandBase *AllocaCmd) { +AllocaCommandBase *Scheduler::GraphBuilder::findAllocaForReq( + MemObjRecord *Record, const Requirement *Req, const ContextImplPtr &Context, + bool allowConst) { + auto IsSuitableAlloca = [&Context, Req, + allowConst](AllocaCommandBase *AllocaCmd) { bool Res = sameCtx(AllocaCmd->getQueue()->getContextImplPtr(), Context); if (IsSuitableSubReq(Req)) { const Requirement *TmpReq = AllocaCmd->getRequirement(); @@ -724,7 +723,8 @@ AllocaCommandBase *Scheduler::GraphBuilder::getOrCreateAllocaForReq( Scheduler::getInstance().getDefaultHostQueue(); AllocaCommand *HostAllocaCmd = new AllocaCommand( DefaultHostQueue, FullReq, true /* InitFromUserData */, - nullptr /* LinkedAllocaCmd */, MemObj->isHostPointerReadOnly() /* IsConst */); + nullptr /* LinkedAllocaCmd */, + MemObj->isHostPointerReadOnly() /* IsConst */); Record->MAllocaCommands.push_back(HostAllocaCmd); Record->MWriteLeaves.push_back(HostAllocaCmd, ToEnqueue); ++(HostAllocaCmd->MLeafCounter); From 48a47c8f0744c14e6e88ae46c94441b6cdcbcfd3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tadej=20Ciglari=C4=8D?= Date: Tue, 5 Jul 2022 16:00:14 +0100 Subject: [PATCH 3/6] fix reorder warning --- sycl/source/detail/scheduler/commands.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sycl/source/detail/scheduler/commands.cpp b/sycl/source/detail/scheduler/commands.cpp index 591f73478a3f3..0f761cb77727f 100644 --- a/sycl/source/detail/scheduler/commands.cpp +++ b/sycl/source/detail/scheduler/commands.cpp @@ -836,8 +836,8 @@ AllocaCommandBase::AllocaCommandBase(CommandType Type, QueueImplPtr Queue, AllocaCommandBase *LinkedAllocaCmd, bool IsConst) : Command(Type, Queue), MLinkedAllocaCmd(LinkedAllocaCmd), - MIsLeaderAlloca(nullptr == LinkedAllocaCmd), MRequirement(std::move(Req)), - MReleaseCmd(Queue, this), MIsConst(IsConst) { + MIsLeaderAlloca(nullptr == LinkedAllocaCmd), MIsConst(IsConst), + MRequirement(std::move(Req)), MReleaseCmd(Queue, this) { MRequirement.MAccessMode = access::mode::read_write; emitInstrumentationDataProxy(); } From 3d5605153366ca7ad6085cb8da94ff28412119ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tadej=20Ciglari=C4=8D?= Date: Tue, 2 Aug 2022 14:20:42 +0100 Subject: [PATCH 4/6] addressed review comments --- sycl/source/detail/memory_manager.cpp | 2 +- sycl/source/detail/scheduler/commands.hpp | 2 +- sycl/source/detail/scheduler/graph_builder.cpp | 6 +++--- sycl/source/detail/scheduler/scheduler.hpp | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sycl/source/detail/memory_manager.cpp b/sycl/source/detail/memory_manager.cpp index 78e12c703d07c..fee5cd893b1d1 100644 --- a/sycl/source/detail/memory_manager.cpp +++ b/sycl/source/detail/memory_manager.cpp @@ -295,7 +295,7 @@ void *MemoryManager::wrapIntoImageBuffer(ContextImplPtr TargetContext, void *MemoryManager::allocateHostMemory(SYCLMemObjI *MemObj, void *UserPtr, bool HostPtrReadOnly, size_t Size, const sycl::property_list &) { - // Can return user pointer directly if it points to writable memory. + // Can return user pointer directly if it is not a nullptr. if (UserPtr) return UserPtr; diff --git a/sycl/source/detail/scheduler/commands.hpp b/sycl/source/detail/scheduler/commands.hpp index 8ca6ef0b4ef9c..b84c8f79657a0 100644 --- a/sycl/source/detail/scheduler/commands.hpp +++ b/sycl/source/detail/scheduler/commands.hpp @@ -394,7 +394,7 @@ class AllocaCommandBase : public Command { /// Indicates that the command owns memory allocation in case of connected /// alloca command. bool MIsLeaderAlloca = true; - // Indicates tha thte data in this allocation must not be modified + // Indicates that the data in this allocation must not be modified bool MIsConst = false; protected: diff --git a/sycl/source/detail/scheduler/graph_builder.cpp b/sycl/source/detail/scheduler/graph_builder.cpp index 9d062aaa5cafd..5c2304d56df1a 100644 --- a/sycl/source/detail/scheduler/graph_builder.cpp +++ b/sycl/source/detail/scheduler/graph_builder.cpp @@ -629,16 +629,16 @@ DepDesc Scheduler::GraphBuilder::findDepForRecord(Command *Cmd, // requirement. AllocaCommandBase *Scheduler::GraphBuilder::findAllocaForReq( MemObjRecord *Record, const Requirement *Req, const ContextImplPtr &Context, - bool allowConst) { + bool AllowConst) { auto IsSuitableAlloca = [&Context, Req, - allowConst](AllocaCommandBase *AllocaCmd) { + AllowConst](AllocaCommandBase *AllocaCmd) { bool Res = sameCtx(AllocaCmd->getQueue()->getContextImplPtr(), Context); if (IsSuitableSubReq(Req)) { const Requirement *TmpReq = AllocaCmd->getRequirement(); Res &= AllocaCmd->getType() == Command::CommandType::ALLOCA_SUB_BUF; Res &= TmpReq->MOffsetInBytes == Req->MOffsetInBytes; Res &= TmpReq->MSYCLMemObj->getSize() == Req->MSYCLMemObj->getSize(); - Res &= allowConst || !AllocaCmd->MIsConst; + Res &= AllowConst || !AllocaCmd->MIsConst; } return Res; }; diff --git a/sycl/source/detail/scheduler/scheduler.hpp b/sycl/source/detail/scheduler/scheduler.hpp index 925c4776248b8..ed7890b5dc412 100644 --- a/sycl/source/detail/scheduler/scheduler.hpp +++ b/sycl/source/detail/scheduler/scheduler.hpp @@ -619,7 +619,7 @@ class Scheduler { AllocaCommandBase *findAllocaForReq(MemObjRecord *Record, const Requirement *Req, const ContextImplPtr &Context, - bool allowConst = true); + bool AllowConst = true); friend class Command; From f4ab95712bf71ed75dcf4b6b67460d04182c1f91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tadej=20Ciglari=C4=8D?= Date: Wed, 10 Aug 2022 08:19:56 +0100 Subject: [PATCH 5/6] addressed review comments --- sycl/source/detail/memory_manager.cpp | 3 +-- sycl/source/detail/scheduler/commands.cpp | 2 +- sycl/source/detail/scheduler/commands.hpp | 2 +- sycl/source/detail/scheduler/graph_builder.cpp | 4 ++-- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/sycl/source/detail/memory_manager.cpp b/sycl/source/detail/memory_manager.cpp index 0b81481d2f16b..f2d2f26b9da4f 100644 --- a/sycl/source/detail/memory_manager.cpp +++ b/sycl/source/detail/memory_manager.cpp @@ -280,8 +280,7 @@ void *MemoryManager::allocateHostMemory(SYCLMemObjI *MemObj, void *UserPtr, if (UserPtr) return UserPtr; - void *NewMem = MemObj->allocateHostMem(); - return NewMem; + return MemObj->allocateHostMem();; } void *MemoryManager::allocateInteropMemObject( diff --git a/sycl/source/detail/scheduler/commands.cpp b/sycl/source/detail/scheduler/commands.cpp index 35099b5eef404..a121e09082c54 100644 --- a/sycl/source/detail/scheduler/commands.cpp +++ b/sycl/source/detail/scheduler/commands.cpp @@ -950,7 +950,7 @@ AllocaSubBufCommand::AllocaSubBufCommand(QueueImplPtr Queue, Requirement Req, std::vector &ToCleanUp) : AllocaCommandBase(CommandType::ALLOCA_SUB_BUF, std::move(Queue), std::move(Req), - /*LinkedAllocaCmd*/ nullptr), + /*LinkedAllocaCmd*/ nullptr, /*IsConst*/ false), MParentAlloca(ParentAlloca) { // Node event must be created before the dependent edge // is added to this node, so this call must be before diff --git a/sycl/source/detail/scheduler/commands.hpp b/sycl/source/detail/scheduler/commands.hpp index b84c8f79657a0..5dbbf9160b445 100644 --- a/sycl/source/detail/scheduler/commands.hpp +++ b/sycl/source/detail/scheduler/commands.hpp @@ -364,7 +364,7 @@ class ReleaseCommand : public Command { class AllocaCommandBase : public Command { public: AllocaCommandBase(CommandType Type, QueueImplPtr Queue, Requirement Req, - AllocaCommandBase *LinkedAllocaCmd, bool IsConst = false); + AllocaCommandBase *LinkedAllocaCmd, bool IsConst); ReleaseCommand *getReleaseCmd() { return &MReleaseCmd; } diff --git a/sycl/source/detail/scheduler/graph_builder.cpp b/sycl/source/detail/scheduler/graph_builder.cpp index e7eadcc6e308e..1b6ee70c2aa8b 100644 --- a/sycl/source/detail/scheduler/graph_builder.cpp +++ b/sycl/source/detail/scheduler/graph_builder.cpp @@ -670,7 +670,7 @@ AllocaCommandBase *Scheduler::GraphBuilder::getOrCreateAllocaForReq( std::vector &ToEnqueue) { AllocaCommandBase *AllocaCmd = - findAllocaForReq(Record, Req, Queue->getContextImplPtr(), false); + findAllocaForReq(Record, Req, Queue->getContextImplPtr(), /*AllowConst=*/false); if (!AllocaCmd) { std::vector ToCleanUp; @@ -757,7 +757,7 @@ AllocaCommandBase *Scheduler::GraphBuilder::getOrCreateAllocaForReq( : HostUnifiedMemory; if (PinnedHostMemory || HostUnifiedMemoryOnNonHostDevice) { AllocaCommandBase *LinkedAllocaCmdCand = - findAllocaForReq(Record, Req, Record->MCurContext, false); + findAllocaForReq(Record, Req, Record->MCurContext, /*AllowConst=*/false); // Cannot setup link if candidate is linked already if (LinkedAllocaCmdCand && From e1d9b8f6eb7d59ac7ab33bc0d2ae5798ab62680c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tadej=20Ciglari=C4=8D?= Date: Wed, 10 Aug 2022 08:23:13 +0100 Subject: [PATCH 6/6] format --- sycl/source/detail/memory_manager.cpp | 3 ++- sycl/source/detail/scheduler/graph_builder.cpp | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/sycl/source/detail/memory_manager.cpp b/sycl/source/detail/memory_manager.cpp index f2d2f26b9da4f..c9dbe5aeeca28 100644 --- a/sycl/source/detail/memory_manager.cpp +++ b/sycl/source/detail/memory_manager.cpp @@ -280,7 +280,8 @@ void *MemoryManager::allocateHostMemory(SYCLMemObjI *MemObj, void *UserPtr, if (UserPtr) return UserPtr; - return MemObj->allocateHostMem();; + return MemObj->allocateHostMem(); + ; } void *MemoryManager::allocateInteropMemObject( diff --git a/sycl/source/detail/scheduler/graph_builder.cpp b/sycl/source/detail/scheduler/graph_builder.cpp index 1b6ee70c2aa8b..8fa6a54991d94 100644 --- a/sycl/source/detail/scheduler/graph_builder.cpp +++ b/sycl/source/detail/scheduler/graph_builder.cpp @@ -669,8 +669,8 @@ AllocaCommandBase *Scheduler::GraphBuilder::getOrCreateAllocaForReq( MemObjRecord *Record, const Requirement *Req, QueueImplPtr Queue, std::vector &ToEnqueue) { - AllocaCommandBase *AllocaCmd = - findAllocaForReq(Record, Req, Queue->getContextImplPtr(), /*AllowConst=*/false); + AllocaCommandBase *AllocaCmd = findAllocaForReq( + Record, Req, Queue->getContextImplPtr(), /*AllowConst=*/false); if (!AllocaCmd) { std::vector ToCleanUp; @@ -756,8 +756,8 @@ AllocaCommandBase *Scheduler::GraphBuilder::getOrCreateAllocaForReq( Queue->is_host() ? checkHostUnifiedMemory(Record->MCurContext) : HostUnifiedMemory; if (PinnedHostMemory || HostUnifiedMemoryOnNonHostDevice) { - AllocaCommandBase *LinkedAllocaCmdCand = - findAllocaForReq(Record, Req, Record->MCurContext, /*AllowConst=*/false); + AllocaCommandBase *LinkedAllocaCmdCand = findAllocaForReq( + Record, Req, Record->MCurContext, /*AllowConst=*/false); // Cannot setup link if candidate is linked already if (LinkedAllocaCmdCand &&