@@ -88,14 +88,6 @@ class Comparison {
8888 // targets may support total order floating point type comparisons.
8989 explicit Comparison (Direction dir, PrimitiveType type, Order order);
9090
91- // Two comparisons are equivalent iff they have the same direction, precision,
92- // and ordering.
93- bool operator ==(const Comparison& other) const {
94- return GetDirection () == other.GetDirection () &&
95- GetPrimitiveType () == other.GetPrimitiveType () &&
96- GetOrder () == other.GetOrder ();
97- }
98-
9991 // Returns a comparison with a primitive type matching the Comparison::Type
10092 // and using a default bit width of 32. For example,
10193 // Comparison(Direction::kLt, Type::kFloat).PrimitiveType() /* F32 */
@@ -257,6 +249,18 @@ auto LessThanByKey(KeyFn&& key_fn) {
257249 return [=](const auto & a, const auto & b) { return key_fn (a) < key_fn (b); };
258250}
259251
252+ // Two comparisons are equivalent iff they have the same direction, precision,
253+ // and ordering.
254+ inline bool operator ==(const Comparison& a, const Comparison& b) {
255+ return a.GetDirection () == b.GetDirection () &&
256+ a.GetPrimitiveType () == b.GetPrimitiveType () &&
257+ a.GetOrder () == b.GetOrder ();
258+ }
259+
260+ inline bool operator !=(const Comparison& a, const Comparison& b) {
261+ return !(a == b);
262+ }
263+
260264} // namespace xla
261265
262266#endif // TENSORFLOW_COMPILER_XLA_COMPARISON_UTIL_H_
0 commit comments