8000 reduce all -> array by syurkevi · Pull Request #3199 · arrayfire/arrayfire · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

reduce all -> array #3199

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 11, 2022
Merged

reduce all -> array #3199

merged 2 commits into from
Apr 11, 2022

Conversation

syurkevi
Copy link
Contributor
@syurkevi syurkevi commented Dec 8, 2021

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

  • Rebased on latest master
  • Code compiles
  • Tests pass
  • Functions added to unified API
  • Functions documented

@syurkevi syurkevi changed the title reduce all -> array reduce all -> array [WIP] Dec 8, 2021
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
@syurkevi syurkevi changed the title reduce all -> array [WIP] reduce all -> array Mar 21, 2022
umar456
umar456 previously approved these changes Mar 21, 2022
8000
@syurkevi syurkevi merged commit 8bdcc77 into arrayfire:master Apr 11, 2022
@jacobkahn
Copy link
Contributor

Very happy to see this committed - thanks for the work @syurkevi!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0