Skip to content

[SYCL] Avoid copying of NormalizedKernelFunc temporary #11368

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions sycl/include/sycl/handler.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -729,9 +729,9 @@ class __SYCL_EXPORT handler {
NormalizedKernelType NormalizedKernel(KernelFunc);
auto NormalizedKernelFunc =
std::function<void(const sycl::nd_item<Dims> &)>(NormalizedKernel);
auto HostKernelPtr =
new detail::HostKernel<decltype(NormalizedKernelFunc),
sycl::nd_item<Dims>, Dims>(NormalizedKernelFunc);
auto HostKernelPtr = new detail::HostKernel<decltype(NormalizedKernelFunc),
sycl::nd_item<Dims>, Dims>(
std::move(NormalizedKernelFunc));
MHostKernel.reset(HostKernelPtr);
return &HostKernelPtr->MKernel.template target<NormalizedKernelType>()
->MKernelFunc;
Expand Down