Skip to content

Commit f0aa626

Browse files
committed
Removes sycl::vec overload in BitwiseInvertFunctor
This overload would cause sufficiently large boolean arrays to produce unexpected results when cast to another type
1 parent 7bc3124 commit f0aa626

File tree

1 file changed

+1
-16
lines changed

1 file changed

+1
-16
lines changed

dpctl/tensor/libtensor/include/kernels/elementwise_functions/bitwise_invert.hpp

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ template <typename argT, typename resT> struct BitwiseInvertFunctor
5858

5959
using is_constant = typename std::false_type;
6060
// constexpr resT constant_value = resT{};
61-
using supports_vec = typename std::true_type;
61+
using supports_vec = typename std::false_type;
6262
using supports_sg_loadstore = typename std::true_type;
6363
;
6464

@@ -71,21 +71,6 @@ template <typename argT, typename resT> struct BitwiseInvertFunctor
7171
return ~in;
7272
}
7373
}
74-
75-
template <int vec_sz>
76-
sycl::vec<resT, vec_sz> operator()(const sycl::vec<argT, vec_sz> &in) const
77-
{
78-
if constexpr (std::is_same_v<argT, bool>) {
79-
auto res_vec = !in;
80-
81-
using deducedT = typename std::remove_cv_t<
82-
std::remove_reference_t<decltype(res_vec)>>::element_type;
83-
return vec_cast<resT, deducedT, vec_sz>(res_vec);
84-
}
85-
else {
86-
return ~in;
87-
}
88-
}
8974
};
9075

9176
template <typename argT,

0 commit comments

Comments
 (0)