diff --git a/sycl/include/CL/sycl/detail/stl_type_traits.hpp b/sycl/include/CL/sycl/detail/stl_type_traits.hpp index 82b8509c6a0e4..03403b7ba063e 100644 --- a/sycl/include/CL/sycl/detail/stl_type_traits.hpp +++ b/sycl/include/CL/sycl/detail/stl_type_traits.hpp @@ -78,12 +78,6 @@ struct is_output_iterator> { static constexpr bool value = true; }; -template -inline constexpr bool is_same_v = std::is_same::value; - -template -inline constexpr bool is_convertible_v = std::is_convertible::value; - } // namespace detail } // namespace sycl } // __SYCL_INLINE_NAMESPACE(cl) diff --git a/sycl/include/CL/sycl/handler.hpp b/sycl/include/CL/sycl/handler.hpp index 3004f438e32b9..26dd0e718ba95 100644 --- a/sycl/include/CL/sycl/handler.hpp +++ b/sycl/include/CL/sycl/handler.hpp @@ -927,14 +927,11 @@ class __SYCL_EXPORT handler { } template struct TransformUserItemType { - using type = typename std::conditional_t< - detail::is_same_v, LambdaArgType>, LambdaArgType, - typename std::conditional_t< - detail::is_convertible_v, LambdaArgType>, - nd_item, - typename std::conditional_t< - detail::is_convertible_v, LambdaArgType>, item, - LambdaArgType>>>; + using type = typename std::conditional< + std::is_convertible, LambdaArgType>::value, nd_item, + typename std::conditional< + std::is_convertible, LambdaArgType>::value, item, + LambdaArgType>::type>::type; }; /// Defines and invokes a SYCL kernel function for the specified range. diff --git a/sycl/test/basic_tests/parallel_for_type_check.cpp b/sycl/test/basic_tests/parallel_for_type_check.cpp index 984657c430e4c..5fb03efa4f50a 100644 --- a/sycl/test/basic_tests/parallel_for_type_check.cpp +++ b/sycl/test/basic_tests/parallel_for_type_check.cpp @@ -1,6 +1,7 @@ // RUN: %clangxx -fsycl -fsycl-device-only -D__SYCL_INTERNAL_API -O0 -c -emit-llvm -S -o - %s | FileCheck %s // This test performs basic type check for sycl::id that is used in result type. +// Check that sycl::id is converted from sycl::item. #include #include @@ -21,7 +22,7 @@ int main() { auto buf_acc = data_buf.get_access(h); h.parallel_for( sycl::range<1>{sz}, - // CHECK: cl{{.*}}sycl{{.*}}detail{{.*}}RoundedRangeKernel{{.*}}id{{.*}}main{{.*}}handler + // CHECK: cl{{.*}}sycl{{.*}}detail{{.*}}RoundedRangeKernel{{.*}}item{{.*}}main{{.*}}handler [=](sycl::id<1> item) { buf_acc[item] += 1; }); }); q.wait();