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 2023/01/12 06:44:48 UTC
[GitHub] [arrow] EpsilonPrime commented on a diff in pull request #30309: GH-15200: [C++] Add specific ndigits value for round benchmarks.
EpsilonPrime commented on code in PR #30309:
URL: https://github.com/apache/arrow/pull/30309#discussion_r1067754952
##########
cpp/src/arrow/compute/kernels/scalar_round_benchmark.cc:
##########
@@ -45,6 +45,7 @@ static void RoundArrayBenchmark(benchmark::State& state, const std::string& func
rand.Numeric<ArrowType>(array_size, min, max, args.null_proportion));
RoundOptions options;
options.round_mode = static_cast<RoundMode>(Mode);
+ options.ndigits = 1; // Round to the appropriate tenth.
Review Comment:
For floating point types, yes. For integer types, `ndigits=0` should be optimized away. I suppose I could set it up to run 0/1 for floating point and just 1 for integer types. Not that it makes a difference here but the two arg version of round (the version that will be exposed to Substrait) is going to be using random values from -6 to +6.
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org