Skip to content

Commit

Permalink
[Tests] Improve kernel_param generation for unnamed lambda
Browse files Browse the repository at this point in the history
Signed-off-by: Dmitriy Sobolev <[email protected]>
  • Loading branch information
dmitriy-sobolev committed Apr 23, 2024
1 parent e3d8ba2 commit 14a8b41
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions test/support/utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,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 @@ -898,11 +899,19 @@ struct __kernel_name_with_idx

template <int idx, typename KernelParams>
constexpr auto
get_new_kernel_params(KernelParams)
get_new_kernel_params(KernelParams params)
{
return oneapi::dpl::experimental::kt::kernel_param<
auto new_params = oneapi::dpl::experimental::kt::kernel_param<
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

0 comments on commit 14a8b41

Please sign in to comment.