Skip to content
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

Improve kernel name generation for unnamed lambda (kernel templates) #1524

Merged
merged 4 commits into from
Nov 22, 2024
Merged
Changes from 2 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
13 changes: 11 additions & 2 deletions test/support/utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
#if TEST_DPCPP_BACKEND_PRESENT
# include "utils_sycl.h"
# include "oneapi/dpl/experimental/kt/kernel_param.h"
# include "oneapi/dpl/execution" // for oneapi::dpl::execution::DefaultKernelName
#endif

namespace TestUtils
Expand Down Expand Up @@ -967,11 +968,19 @@ struct __kernel_name_with_idx

template <int idx, typename KernelParams>
constexpr auto
get_new_kernel_params(KernelParams)
get_new_kernel_params([[maybe_unused]] KernelParams params)
SergeyKopienko marked this conversation as resolved.
Show resolved Hide resolved
{
return oneapi::dpl::experimental::kt::kernel_param<
auto new_params = oneapi::dpl::experimental::kt::kernel_param<
SergeyKopienko marked this conversation as resolved.
Show resolved Hide resolved
KernelParams::data_per_workitem, KernelParams::workgroup_size,
__kernel_name_with_idx<typename KernelParams::kernel_name, idx>>{};
#if TEST_EXPLICIT_KERNEL_NAMES
return new_params;
#else
if constexpr (std::is_same_v<typename KernelParams::kernel_name, oneapi::dpl::execution::DefaultKernelName>)
return params;
else
return new_params;
#endif // TEST_EXPLICIT_KERNEL_NAMES
}
#endif //TEST_DPCPP_BACKEND_PRESENT

Expand Down
Loading