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



##########
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 had to reduce the range to avoid overflows. Would it make more sense 
to introduce a separate generator for power benchmark only?




-- 
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:
[email protected]


Reply via email to