dinse commented on code in PR #46829:
URL: https://github.com/apache/arrow/pull/46829#discussion_r2155730970


##########
cpp/src/arrow/compute/kernels/base_arithmetic_internal.h:
##########
@@ -489,6 +490,19 @@ struct Negate {
   }
 };
 
+// Can't tell the difference between HalfFloatType and UInt16Type in
+// enable_if_unsigned_integer_value above, so seperate operator needed
+struct NegateHalfFloat {
+  template <typename T, typename Arg>
+  static constexpr enable_if_unsigned_integer_value<T> Call(KernelContext*, 
Arg arg,
+                                                            Status*) {
+    static_assert(std::is_same<T, Arg>::value, "");
+    using ::arrow::util::Float16;
+    auto val = Float16::FromBits(static_cast<uint16_t>(arg));
+    return (-val).bits();
+  }
+};

Review Comment:
   Fixed



##########
cpp/src/arrow/compute/kernels/base_arithmetic_internal.h:
##########
@@ -489,6 +490,19 @@ struct Negate {
   }
 };
 
+// Can't tell the difference between HalfFloatType and UInt16Type in
+// enable_if_unsigned_integer_value above, so seperate operator needed
+struct NegateHalfFloat {
+  template <typename T, typename Arg>
+  static constexpr enable_if_unsigned_integer_value<T> Call(KernelContext*, 
Arg arg,
+                                                            Status*) {
+    static_assert(std::is_same<T, Arg>::value, "");
+    using ::arrow::util::Float16;

Review Comment:
   Fixed



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to