You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2021/04/13 05:57:48 UTC

[GitHub] [arrow] cyb70289 commented on a change in pull request #9841: ARROW-11070: [C++][Compute] Implement power kernel

cyb70289 commented on a change in pull request #9841:
URL: https://github.com/apache/arrow/pull/9841#discussion_r612149898



##########
File path: cpp/src/arrow/compute/kernels/scalar_arithmetic_benchmark.cc
##########
@@ -62,16 +62,23 @@ static Result<Datum> DivideChecked(const Datum& left, const Datum& right,
   return Divide(left, right, std::move(options), ctx);
 }
 
+static Result<Datum> PowerChecked(const Datum& left, const Datum& right,
+                                  ArithmeticOptions options = ArithmeticOptions(),
+                                  ExecContext* ctx = NULLPTR) {
+  options.check_overflow = true;
+  return Power(left, right, std::move(options), ctx);
+}
+
 template <BinaryOp& Op, typename ArrowType, typename CType = typename ArrowType::c_type>
 static void ArrayScalarKernel(benchmark::State& state) {
   RegressionArgs args(state);
 
   const int64_t array_size = args.size / sizeof(CType);
 
   // Choose values so as to avoid overflow on all ops and types
-  auto min = static_cast<CType>(6);
-  auto max = static_cast<CType>(min + 15);
-  Datum rhs(static_cast<CType>(6));
+  auto min = static_cast<CType>(1);
+  auto max = static_cast<CType>(min + 4);
+  Datum rhs(static_cast<CType>(3));

Review comment:
       I tweaked some code and removed the benchmark.
   For now, I think there are still many things needs to improve. So we don't need to add benchmark in a haste.
   I downloaded and attached your benchmark commit, in case it's lost.
   [0001-Adding-benchmark-for-Power-and-PowerChecked.patch.gz](https://github.com/apache/arrow/files/6301530/0001-Adding-benchmark-for-Power-and-PowerChecked.patch.gz)
   
   




-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org