FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Fixes to the indexed reduce function for the cpu, opencl and cuda back ends by christophe-murphy · Pull Request #3658 · arrayfire/arrayfire · GitHub

Repository navigation

Fixes to the indexed reduce function for the cpu, opencl and cuda back ends - #3658

Merged
christophe-murphy merged 2 commits into
masterfrom
3656-bug-afmax-of-subarray-returns-wrong-location
Jun 25, 2025
Merged

christophe-murphy merged 2 commits into
masterfrom
3656-bug-afmax-of-subarray-returns-wrong-location

Conversation

Copy link
Copy Markdown
Contributor

These back ends were incorrectly assuming a linear array when finding the max/min value and its index. This causes an issue with a sub-array.

Description

In the case of the cuda and opencl back end this was just for the cpu-fallback methods which are used when the total number of elements in the array is less than or equal to 4096. There was no issue with the oneapi back end because it does not have this fall-back method. The fix for the cuda and opencl back ends was to only use the fall-back method for linear arrays. This is to avoid doing a complex sub-array copy operation from device to host memory.

Changes to Users

af_imax_all / af_imin_all functions now works for sub-arrays

Checklist

  • Rebased on latest master
  • Code compiles
  • Tests pass

…k ends.

These back ends were incorrectly assuming a linear array. In the case of the cuda and opencl back end this was just for the cpu-fallback methods which are used when the total number of elements in the array is less than or equal to 4096.
christophe-murphy linked an issue Jun 3, 2025 that may be closed by this pull request
christophe-murphy added this to the 3.10 milestone Jun 3, 2025
syurkevi previously approved these changes Jun 3, 2025
Added an eval() to the input array on the CPU back end for the ireduce method to ensure that the array has been evaluated before reducing.
christophe-murphy merged commit 0e8a690 into master Jun 25, 2025
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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] af::max of subarray returns wrong location

3 participants


Back | FazBrowse Home | New Git URL