@@ -27,8 +27,6 @@ namespace detail {
27
27
28
28
using cl::sycl::detail::bool_constant;
29
29
using cl::sycl::detail::enable_if_t ;
30
- using cl::sycl::detail::is_sgenfloat;
31
- using cl::sycl::detail::is_sgeninteger;
32
30
using cl::sycl::detail::queue_impl;
33
31
using cl::sycl::detail::remove_AS;
34
32
@@ -45,7 +43,7 @@ using IsReduOptForFastAtomicFetch =
45
43
#ifdef SYCL_REDUCTION_DETERMINISTIC
46
44
bool_constant<false >;
47
45
#else
48
- bool_constant<is_sgeninteger<T>::value &&
46
+ bool_constant<sycl::detail:: is_sgeninteger<T>::value &&
49
47
sycl::detail::IsValidAtomicType<T>::value &&
50
48
(sycl::detail::IsPlus<T, BinaryOperation>::value ||
51
49
sycl::detail::IsMinimum<T, BinaryOperation>::value ||
@@ -55,14 +53,23 @@ using IsReduOptForFastAtomicFetch =
55
53
sycl::detail::IsBitAND<T, BinaryOperation>::value)>;
56
54
#endif
57
55
56
+ // This type trait is used to detect if the group algorithm reduce() used with
57
+ // operands of the type T and the operation BinaryOperation is available
58
+ // for using in reduction.
59
+ // The macro SYCL_REDUCTION_DETERMINISTIC prohibits using the reduce() algorithm
60
+ // to produce stable results across same type devices.
58
61
template <typename T, class BinaryOperation >
59
62
using IsReduOptForFastReduce =
60
- bool_constant<((is_sgeninteger<T>::value &&
63
+ #ifdef SYCL_REDUCTION_DETERMINISTIC
64
+ bool_constant<false >;
65
+ #else
66
+ bool_constant<((sycl::detail::is_sgeninteger<T>::value &&
61
67
(sizeof (T) == 4 || sizeof (T) == 8 )) ||
62
- is_sgenfloat<T>::value) &&
68
+ sycl::detail:: is_sgenfloat<T>::value) &&
63
69
(sycl::detail::IsPlus<T, BinaryOperation>::value ||
64
70
sycl::detail::IsMinimum<T, BinaryOperation>::value ||
65
71
sycl::detail::IsMaximum<T, BinaryOperation>::value)>;
72
+ #endif
66
73
67
74
// std::tuple seems to be a) too heavy and b) not copyable to device now
68
75
// Thus sycl::detail::tuple is used instead.
0 commit comments