Skip to content

[SYCL] Reorder KernelWrapper::wrap() for kernel functor #19442

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

Open
wants to merge 2 commits into
base: sycl
Choose a base branch
from
Open
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
11 changes: 8 additions & 3 deletions sycl/include/sycl/handler.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1633,8 +1633,6 @@ class __SYCL_EXPORT handler {
using NameT =
typename detail::get_kernel_name_t<KernelName, KernelType>::name;
(void)Props;
KernelWrapper<WrapAsVal, NameT, KernelType, ElementType, PropertiesT>::wrap(
this, KernelFunc);
#ifndef __SYCL_DEVICE_ONLY__
if constexpr (WrapAsVal == WrapAs::single_task) {
throwOnKernelParameterMisuse<KernelName, KernelType>();
Expand All @@ -1651,7 +1649,14 @@ class __SYCL_EXPORT handler {
} else {
setNDRangeDescriptor(std::move(params)...);
}

#endif
// NOTE: KernelWrapper::wrap() was moved here to support properties that are
// included in kernel functor with a
// get(sycl::ext::oneapi::experimental::properties_tag) and need modify
// NDRangeDescriptor values after NDRangeDescriptor was set.
KernelWrapper<WrapAsVal, NameT, KernelType, ElementType, PropertiesT>::wrap(
this, KernelFunc);
#ifndef __SYCL_DEVICE_ONLY__
StoreLambda<NameT, KernelType, Dims, ElementType>(std::move(KernelFunc));
processProperties<detail::isKernelESIMD<NameT>(), PropertiesT>(Props);
#endif
Expand Down
Loading