Merged
Conversation
3797ac3 to
4c8808b
Compare
syurkevi
commented
Dec 16, 2021
0d5c7f8 to
a720d85
Compare
adds single cuda kernel for reduce_all_array adds cpu reduce_all adds opencl reduce_all functions, kernel: todo remove old versions of reduce_all update missing reduction functions adds missing reduce tests, other reduce functions update test precision, fix kernel shared ptrs fixes failing tests, clang format, fix init assignment update api, minor unified error handling
a720d85 to
f4fe20a
Compare
umar456
previously approved these changes
Mar 21, 2022
umar456
approved these changes
Apr 11, 2022
Contributor
|
Very happy to see this committed - thanks for the work @syurkevi! |
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.
This PR adds af::array as a return type to the reduction functions. ( reduceaf::array(arr); )
Description
Previously, the reduce all functions would return a scalar value. The return of an af::array type was missing. Furthermore, the return of a scalar causes a mandatory synchronization at the function call.
Is this a new feature or a bug fix?
New feature
More detail if necessary to describe all commits in pull request.
Partial commits contain separate API changes, kernels for each backend, and tests as described in each commit message. Will be squashed before merging.
Why these changes are necessary.
To improve performance by avoiding unnecessary synchronization at each reduce<>() call.
Potential impact on specific hardware, software or backends.
New functions and their functionality.
Adds af_sum_array, af_sum_nan_array, af_product_array, af_product_nan_array, af_min_array, af_max_array, af_count_array, af_all_true_array, af_any_true_array, and the corresponding C++ versions such as af::maxaf::array(arr);
Can this PR be backported to older versions?
No, breaks API
Changes to Users
Existing code should be compatible. Users can now specify af::array as a template argument for reduction functions.
Checklist