Skip to content

Commit dcb566a

Browse files
Corrected logical error in can_use_reduce_over_group trait implementation
1 parent 702b707 commit dcb566a

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

dpctl/tensor/libtensor/include/kernels/reductions.hpp

+8-2
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,18 @@ namespace tensor
5050
namespace kernels
5151
{
5252

53+
template <typename ReductionOpT, typename T> struct needs_workaround
54+
{
55+
static constexpr bool value =
56+
std::is_same_v<ReductionOpT, sycl::multiplies<T>> &&
57+
(std::is_same_v<T, std::int64_t> || std::is_same_v<T, std::uint64_t>);
58+
};
59+
5360
template <typename ReductionOpT, typename T> struct can_use_reduce_over_group
5461
{
5562
static constexpr bool value =
5663
sycl::has_known_identity<ReductionOpT, T>::value &&
57-
!std::is_same_v<T, std::int64_t> && !std::is_same_v<T, std::uint64_t> &&
58-
!std::is_same_v<ReductionOpT, sycl::multiplies<T>>;
64+
!needs_workaround<ReductionOpT, T>::value;
5965
};
6066

6167
template <typename argT,

0 commit comments

Comments
 (0)