Repository navigation
GH-36931: [C++] Add cumulative_mean function - #36932
Merged
Merged
Conversation
|
|
pitrou
requested changes
Aug 9, 2023
pitrou
reviewed
Aug 9, 2023
Comment on lines
+318
to
+330
| // A kernel factory that forwards to CumulativeBinaryOp<Op, ...> for the given type. | ||
| // Need to use a struct because template-using declarations cannot appear in | ||
| // function scope. | ||
| template <typename Op, typename OptionsType> | ||
| struct MakeVectorCumulativeBinaryOpFunction { | ||
| template <typename ArgType> | ||
| using State = CumulativeBinaryOp<Op, ArgType>; | ||
|
|
||
| static void Call(FunctionRegistry* registry, std::string func_name, FunctionDoc doc) { | ||
| MakeVectorCumulativeStatefulFunction<State, OptionsType>( | ||
| registry, std::move(func_name), std::move(doc)); | ||
| } | ||
| }; |
Member
There was a problem hiding this comment.
@bkietz Can you think of a more straightforward way to do this?
pitrou
approved these changes
Aug 9, 2023
Member
|
+1 |
|
After merging your PR, Conbench analyzed the 6 benchmarking runs that have been run so far on merge-commit 6e6e6f0. There were no benchmark performance regressions. 🎉 The full Conbench report has more details. It also includes information about possible false positives for unstable benchmarks that are known to sometimes produce them. |
loicalleyne
pushed a commit
to loicalleyne/arrow
that referenced
this pull request
Nov 13, 2023
### Rationale for this change Add `cumulative_mean` function ### What changes are included in this PR? Implement `cumulative_mean` function. The current cumulative_* kernel generator can only be based on a simple binary arithmetic op and the state can only be a single value. I refactored it to using of a generic state such that it can handle complex operations such as `mean`, `median`, `var` etc. ### Are these changes tested? Yes ### Are there any user-facing changes? No * Closes: apache#36931 Lead-authored-by: Jin Shang <[email protected]> Co-authored-by: Antoine Pitrou <[email protected]> Signed-off-by: Antoine Pitrou <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rationale for this change
Add
cumulative_meanfunctionWhat changes are included in this PR?
Implement
cumulative_meanfunction. The current cumulative_* kernel generator can only be based on a simple binary arithmetic op and the state can only be a single value. I refactored it to using of a generic state such that it can handle complex operations such asmean,median,varetc.Are these changes tested?
Yes
Are there any user-facing changes?
No