Skip to content

Commit 3a7d4f4

Browse files
committed
Update the KernelType definition to use std::decay_t and detail::nth_type_t
1 parent 2e36d56 commit 3a7d4f4

File tree

1 file changed

+6
-12
lines changed

1 file changed

+6
-12
lines changed

sycl/include/sycl/queue.hpp

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,7 @@ auto submit_kernel_direct(
130130
const detail::code_location &CodeLoc = detail::code_location::current()) {
131131
detail::tls_code_loc_t TlsCodeLocCapture(CodeLoc);
132132

133-
using KernelType =
134-
std::remove_const_t<std::remove_reference_t<KernelTypeUniversalRef>>;
133+
using KernelType = std::decay_t<KernelTypeUniversalRef>;
135134

136135
using NameT =
137136
typename detail::get_kernel_name_t<KernelName, KernelType>::name;
@@ -209,8 +208,7 @@ auto submit_kernel_direct_parallel_for(
209208
const PropertiesT &Props = ext::oneapi::experimental::empty_properties_t{},
210209
const detail::code_location &CodeLoc = detail::code_location::current()) {
211210

212-
using KernelType =
213-
std::remove_const_t<std::remove_reference_t<KernelTypeUniversalRef>>;
211+
using KernelType = std::decay_t<KernelTypeUniversalRef>;
214212

215213
using LambdaArgType =
216214
sycl::detail::lambda_arg_type<KernelType, nd_item<Dims>>;
@@ -3310,8 +3308,7 @@ class __SYCL_EXPORT queue : public detail::OwnerLessBase<queue> {
33103308
RestT &&...Rest) {
33113309
constexpr detail::code_location CodeLoc = getCodeLocation<KernelName>();
33123310
detail::tls_code_loc_t TlsCodeLocCapture(CodeLoc);
3313-
using KernelType = std::remove_const_t<
3314-
std::remove_reference_t<std::tuple_element_t<0, std::tuple<RestT...>>>>;
3311+
using KernelType = std::decay_t<detail::nth_type_t<0, RestT...>>;
33153312

33163313
// TODO The handler-less path does not support reductions, and
33173314
// kernel functions with the kernel_handler type argument yet.
@@ -3341,8 +3338,7 @@ class __SYCL_EXPORT queue : public detail::OwnerLessBase<queue> {
33413338
parallel_for(nd_range<Dims> Range, RestT &&...Rest) {
33423339
constexpr detail::code_location CodeLoc = getCodeLocation<KernelName>();
33433340
detail::tls_code_loc_t TlsCodeLocCapture(CodeLoc);
3344-
using KernelType = std::remove_const_t<
3345-
std::remove_reference_t<std::tuple_element_t<0, std::tuple<RestT...>>>>;
3341+
using KernelType = std::decay_t<detail::nth_type_t<0, RestT...>>;
33463342

33473343
// TODO The handler-less path does not support reductions, and
33483344
// kernel functions with the kernel_handler type argument yet.
@@ -3404,8 +3400,7 @@ class __SYCL_EXPORT queue : public detail::OwnerLessBase<queue> {
34043400
parallel_for(nd_range<Dims> Range, event DepEvent, RestT &&...Rest) {
34053401
constexpr detail::code_location CodeLoc = getCodeLocation<KernelName>();
34063402
detail::tls_code_loc_t TlsCodeLocCapture(CodeLoc);
3407-
using KernelType = std::remove_const_t<
3408-
std::remove_reference_t<std::tuple_element_t<0, std::tuple<RestT...>>>>;
3403+
using KernelType = std::decay_t<detail::nth_type_t<0, RestT...>>;
34093404

34103405
// TODO The handler-less path does not support reductions, and
34113406
// kernel functions with the kernel_handler type argument yet.
@@ -3472,8 +3467,7 @@ class __SYCL_EXPORT queue : public detail::OwnerLessBase<queue> {
34723467
RestT &&...Rest) {
34733468
constexpr detail::code_location CodeLoc = getCodeLocation<KernelName>();
34743469
detail::tls_code_loc_t TlsCodeLocCapture(CodeLoc);
3475-
using KernelType = std::remove_const_t<
3476-
std::remove_reference_t<std::tuple_element_t<0, std::tuple<RestT...>>>>;
3470+
using KernelType = std::decay_t<detail::nth_type_t<0, RestT...>>;
34773471

34783472
// TODO The handler-less path does not support reductions, and
34793473
// kernel functions with the kernel_handler type argument yet.

0 commit comments

Comments
 (0)