Skip to content

Commit 78f2888

Browse files
committed
Fix performance regression in parallel_for with using id class
1 parent fd73a49 commit 78f2888

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

sycl/include/CL/sycl/handler.hpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -918,10 +918,13 @@ class __SYCL_EXPORT handler {
918918

919919
template <int Dims, typename LambdaArgType> struct TransformUserItemType {
920920
using type = typename std::conditional<
921-
std::is_convertible<nd_item<Dims>, LambdaArgType>::value, nd_item<Dims>,
921+
std::is_same<id<Dims>, LambdaArgType>::value, LambdaArgType,
922922
typename std::conditional<
923-
std::is_convertible<item<Dims>, LambdaArgType>::value, item<Dims>,
924-
LambdaArgType>::type>::type;
923+
std::is_convertible<nd_item<Dims>, LambdaArgType>::value,
924+
nd_item<Dims>,
925+
typename std::conditional<
926+
std::is_convertible<item<Dims>, LambdaArgType>::value,
927+
item<Dims>, LambdaArgType>::type>::type>::type;
925928
};
926929

927930
/// Defines and invokes a SYCL kernel function for the specified range.

0 commit comments

Comments
 (0)