We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
std::unique_ptr<HostKernel<...>>
1 parent 0f42c75 commit 42990a6Copy full SHA for 42990a6
sycl/include/sycl/handler.hpp
@@ -721,8 +721,11 @@ class __SYCL_EXPORT handler {
721
detail::KernelLambdaHasKernelHandlerArgT<KernelType,
722
LambdaArgType>::value;
723
724
- MHostKernel = std::make_unique<
725
- detail::HostKernel<KernelType, LambdaArgType, Dims>>(KernelFunc);
+ // Not using `std::make_unique` to avoid unnecessary instantiations of
+ // `std::unique_ptr<HostKernel<...>>`. Only
726
+ // `std::unique_ptr<HostKernelBase>` is necessary.
727
+ MHostKernel.reset(
728
+ new detail::HostKernel<KernelType, LambdaArgType, Dims>(KernelFunc));
729
730
constexpr bool KernelHasName =
731
detail::getKernelName<KernelName>() != nullptr &&
0 commit comments