Skip to content

Commit 0b3ead2

Browse files
other fixes
Signed-off-by: Tikhomirova, Kseniya <[email protected]>
1 parent f7014de commit 0b3ead2

File tree

3 files changed

+13
-15
lines changed

3 files changed

+13
-15
lines changed

sycl/source/detail/scheduler/commands.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2564,9 +2564,8 @@ getCGKernelInfo(const CGExecKernel &CommandGroup, ContextImplPtr ContextImpl,
25642564
// they can simply be launched directly.
25652565
if (auto KernelBundleImplPtr = CommandGroup.MKernelBundle;
25662566
KernelBundleImplPtr && !KernelBundleImplPtr->isInterop()) {
2567-
auto KernelName = CommandGroup.MKernelName;
2568-
kernel_id KernelID =
2569-
detail::ProgramManager::getInstance().getSYCLKernelID(KernelName);
2567+
kernel_id KernelID = detail::ProgramManager::getInstance().getSYCLKernelID(
2568+
CommandGroup.MKernelName);
25702569

25712570
kernel SyclKernel =
25722571
KernelBundleImplPtr->get_kernel(KernelID, KernelBundleImplPtr);
@@ -2770,16 +2769,16 @@ void enqueueImpKernel(
27702769
// Initialize device globals associated with this.
27712770
std::vector<ur_event_handle_t> DeviceGlobalInitEvents =
27722771
ContextImpl->initializeDeviceGlobals(Program, Queue);
2773-
std::vector<ur_event_handle_t> EventsWithDeviceGlobalInits;
27742772
if (!DeviceGlobalInitEvents.empty()) {
2773+
std::vector<ur_event_handle_t> EventsWithDeviceGlobalInits;
27752774
EventsWithDeviceGlobalInits.reserve(RawEvents.size() +
27762775
DeviceGlobalInitEvents.size());
27772776
EventsWithDeviceGlobalInits.insert(EventsWithDeviceGlobalInits.end(),
27782777
RawEvents.begin(), RawEvents.end());
27792778
EventsWithDeviceGlobalInits.insert(EventsWithDeviceGlobalInits.end(),
27802779
DeviceGlobalInitEvents.begin(),
27812780
DeviceGlobalInitEvents.end());
2782-
EventsWaitList = EventsWithDeviceGlobalInits;
2781+
EventsWaitList = std::move(EventsWithDeviceGlobalInits);
27832782
}
27842783

27852784
ur_result_t Error = UR_RESULT_SUCCESS;

sycl/source/handler.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -543,11 +543,10 @@ event handler::finalize() {
543543
// In-order queues create implicit linear dependencies between nodes.
544544
// Find the last node added to the graph from this queue, so our new
545545
// node can set it as a predecessor.
546-
auto DependentNode = GraphImpl->getLastInorderNode(MQueue);
547546
std::vector<std::shared_ptr<ext::oneapi::experimental::detail::node_impl>>
548547
Deps;
549-
if (DependentNode) {
550-
Deps.push_back(DependentNode);
548+
if (auto DependentNode = GraphImpl->getLastInorderNode(MQueue)) {
549+
Deps.push_back(std::move(DependentNode));
551550
}
552551
NodeImpl = GraphImpl->add(NodeType, std::move(CommandGroup), Deps);
553552

@@ -571,7 +570,7 @@ event handler::finalize() {
571570
}
572571

573572
// Associate an event with this new node and return the event.
574-
GraphImpl->addEventForNode(EventImpl, NodeImpl);
573+
GraphImpl->addEventForNode(EventImpl, std::move(NodeImpl));
575574

576575
return detail::createSyclObjFromImpl<event>(EventImpl);
577576
}

sycl/source/queue.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -190,12 +190,12 @@ event queue::mem_advise(const void *Ptr, size_t Length, int Advice,
190190
/// TODO: Unused. Remove these when ABI-break window is open.
191191
event queue::submit_impl(std::function<void(handler &)> CGH,
192192
const detail::code_location &CodeLoc) {
193-
return submit_with_event_impl(CGH, {}, CodeLoc, true);
193+
return submit_with_event_impl(std::move(CGH), {}, CodeLoc, true);
194194
}
195195
event queue::submit_impl(std::function<void(handler &)> CGH,
196196
const detail::code_location &CodeLoc,
197197
bool IsTopCodeLoc) {
198-
return submit_with_event_impl(CGH, {}, CodeLoc, IsTopCodeLoc);
198+
return submit_with_event_impl(std::move(CGH), {}, CodeLoc, IsTopCodeLoc);
199199
}
200200

201201
event queue::submit_impl(std::function<void(handler &)> CGH, queue SecondQueue,
@@ -210,27 +210,27 @@ event queue::submit_impl(std::function<void(handler &)> CGH, queue SecondQueue,
210210

211211
void queue::submit_without_event_impl(std::function<void(handler &)> CGH,
212212
const detail::code_location &CodeLoc) {
213-
submit_without_event_impl(CGH, {}, CodeLoc, true);
213+
submit_without_event_impl(std::move(CGH), {}, CodeLoc, true);
214214
}
215215
void queue::submit_without_event_impl(std::function<void(handler &)> CGH,
216216
const detail::code_location &CodeLoc,
217217
bool IsTopCodeLoc) {
218-
submit_without_event_impl(CGH, {}, CodeLoc, IsTopCodeLoc);
218+
submit_without_event_impl(std::move(CGH), {}, CodeLoc, IsTopCodeLoc);
219219
}
220220

221221
event queue::submit_impl_and_postprocess(
222222
std::function<void(handler &)> CGH, const detail::code_location &CodeLoc,
223223
const detail::SubmitPostProcessF &PostProcess) {
224224
detail::SubmissionInfo SI{};
225225
SI.PostProcessorFunc() = std::move(PostProcess);
226-
return submit_with_event_impl(CGH, SI, CodeLoc, true);
226+
return submit_with_event_impl(std::move(CGH), SI, CodeLoc, true);
227227
}
228228
event queue::submit_impl_and_postprocess(
229229
std::function<void(handler &)> CGH, const detail::code_location &CodeLoc,
230230
const detail::SubmitPostProcessF &PostProcess, bool IsTopCodeLoc) {
231231
detail::SubmissionInfo SI{};
232232
SI.PostProcessorFunc() = std::move(PostProcess);
233-
return submit_with_event_impl(CGH, SI, CodeLoc, IsTopCodeLoc);
233+
return submit_with_event_impl(std::move(CGH), SI, CodeLoc, IsTopCodeLoc);
234234
}
235235

236236
event queue::submit_impl_and_postprocess(

0 commit comments

Comments
 (0)