Skip to content

Commit

Permalink
Corrected logical error in can_use_reduce_over_group trait implementa…
Browse files Browse the repository at this point in the history
…tion
  • Loading branch information
oleksandr-pavlyk committed Oct 26, 2023
1 parent 702b707 commit dcb566a
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions dpctl/tensor/libtensor/include/kernels/reductions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,18 @@ namespace tensor
namespace kernels
{

template <typename ReductionOpT, typename T> struct needs_workaround
{
static constexpr bool value =
std::is_same_v<ReductionOpT, sycl::multiplies<T>> &&
(std::is_same_v<T, std::int64_t> || std::is_same_v<T, std::uint64_t>);
};

template <typename ReductionOpT, typename T> struct can_use_reduce_over_group
{
static constexpr bool value =
sycl::has_known_identity<ReductionOpT, T>::value &&
!std::is_same_v<T, std::int64_t> && !std::is_same_v<T, std::uint64_t> &&
!std::is_same_v<ReductionOpT, sycl::multiplies<T>>;
!needs_workaround<ReductionOpT, T>::value;
};

template <typename argT,
Expand Down

0 comments on commit dcb566a

Please sign in to comment.