Skip to content

Commit fff92a6

Browse files
committed
Align not_equal type map to other comparisons
Overloads for combinations of complex and real valued floats are unnecessary, as floats can be safely cast to complex
1 parent 7757857 commit fff92a6

File tree

1 file changed

+1
-17
lines changed
  • dpctl/tensor/libtensor/include/kernels/elementwise_functions

1 file changed

+1
-17
lines changed

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

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -61,19 +61,7 @@ template <typename argT1, typename argT2, typename resT> struct NotEqualFunctor
6161

6262
resT operator()(const argT1 &in1, const argT2 &in2) const
6363
{
64-
if constexpr (std::is_same_v<argT1, std::complex<float>> &&
65-
std::is_same_v<argT2, float>)
66-
{
67-
return (std::real(in1) != in2 || std::imag(in1) != 0.0f);
68-
}
69-
else if constexpr (std::is_same_v<argT1, float> &&
70-
std::is_same_v<argT2, std::complex<float>>)
71-
{
72-
return (in1 != std::real(in2) || std::imag(in2) != 0.0f);
73-
}
74-
else {
75-
return (in1 != in2);
76-
}
64+
return (in1 != in2);
7765
}
7866

7967
template <int vec_sz>
@@ -160,10 +148,6 @@ template <typename T1, typename T2> struct NotEqualOutputType
160148
T2,
161149
std::complex<double>,
162150
bool>,
163-
td_ns::
164-
BinaryTypeMapResultEntry<T1, float, T2, std::complex<float>, bool>,
165-
td_ns::
166-
BinaryTypeMapResultEntry<T1, std::complex<float>, T2, float, bool>,
167151
td_ns::DefaultResultEntry<void>>::result_type;
168152
};
169153

0 commit comments

Comments
 (0)