Skip to content

Commit ee949ac

Browse files
[NFC][SYCL] Don't create unnecessary lambdas calling submitMemOpHelper (#18709)
1 parent 7840ee2 commit ee949ac

File tree

1 file changed

+7
-14
lines changed

1 file changed

+7
-14
lines changed

sycl/source/detail/queue_impl.cpp

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -182,8 +182,7 @@ event queue_impl::memset(const std::shared_ptr<detail::queue_impl> &Self,
182182
return submitMemOpHelper(
183183
Self, DepEvents, CallerNeedsEvent,
184184
[&](handler &CGH) { CGH.memset(Ptr, Value, Count); },
185-
[](const auto &...Args) { MemoryManager::fill_usm(Args...); }, Ptr, Self,
186-
Count, Pattern);
185+
MemoryManager::fill_usm, Ptr, Self, Count, Pattern);
187186
}
188187

189188
void report(const code_location &CodeLoc) {
@@ -234,8 +233,7 @@ event queue_impl::memcpy(const std::shared_ptr<detail::queue_impl> &Self,
234233
return submitMemOpHelper(
235234
Self, DepEvents, CallerNeedsEvent,
236235
[&](handler &CGH) { CGH.memcpy(Dest, Src, Count); },
237-
[](const auto &...Args) { MemoryManager::copy_usm(Args...); }, Src, Self,
238-
Count, Dest);
236+
MemoryManager::copy_usm, Src, Self, Count, Dest);
239237
}
240238

241239
event queue_impl::mem_advise(const std::shared_ptr<detail::queue_impl> &Self,
@@ -246,8 +244,7 @@ event queue_impl::mem_advise(const std::shared_ptr<detail::queue_impl> &Self,
246244
return submitMemOpHelper(
247245
Self, DepEvents, CallerNeedsEvent,
248246
[&](handler &CGH) { CGH.mem_advise(Ptr, Length, Advice); },
249-
[](const auto &...Args) { MemoryManager::advise_usm(Args...); }, Ptr,
250-
Self, Length, Advice);
247+
MemoryManager::advise_usm, Ptr, Self, Length, Advice);
251248
}
252249

253250
event queue_impl::memcpyToDeviceGlobal(
@@ -260,10 +257,8 @@ event queue_impl::memcpyToDeviceGlobal(
260257
CGH.memcpyToDeviceGlobal(DeviceGlobalPtr, Src, IsDeviceImageScope,
261258
NumBytes, Offset);
262259
},
263-
[](const auto &...Args) {
264-
MemoryManager::copy_to_device_global(Args...);
265-
},
266-
DeviceGlobalPtr, IsDeviceImageScope, Self, NumBytes, Offset, Src);
260+
MemoryManager::copy_to_device_global, DeviceGlobalPtr, IsDeviceImageScope,
261+
Self, NumBytes, Offset, Src);
267262
}
268263

269264
event queue_impl::memcpyFromDeviceGlobal(
@@ -276,10 +271,8 @@ event queue_impl::memcpyFromDeviceGlobal(
276271
CGH.memcpyFromDeviceGlobal(Dest, DeviceGlobalPtr, IsDeviceImageScope,
277272
NumBytes, Offset);
278273
},
279-
[](const auto &...Args) {
280-
MemoryManager::copy_from_device_global(Args...);
281-
},
282-
DeviceGlobalPtr, IsDeviceImageScope, Self, NumBytes, Offset, Dest);
274+
MemoryManager::copy_from_device_global, DeviceGlobalPtr,
275+
IsDeviceImageScope, Self, NumBytes, Offset, Dest);
283276
}
284277

285278
sycl::detail::optional<event>

0 commit comments

Comments
 (0)