Skip to content

Conversation

@willyborn
Copy link
Contributor

Using sub-arrays in the reduceByKey function results in undefined behaviour in the opencl & oneapi backend.

Description

The offsets were not taken into account in the opencl & oneapi code.

28bd6b0: adds the the function toTempFormat to the test helpers. This function generates the different temporary array formats (JIT array, SUB-array, Linear array, ...) used by arrayfire.
d0bf731: Adds the offset to the cl code files & adds extra tests for scan.

Is this a new feature or a bug fix?
BUG
Why these changes are necessary.
PREVIOUSLY THE RESULT IS UNDEFINED FOR ABOVE SITUATION
Potential impact on specific hardware, software or backends.
ONEAPI & OPENCL
New functions and their functionality.
NO
Can this PR be backported to older versions?
YES, changes are very local
Future changes not implemented in this PR.
NONE, although the function toTempFormat will be used in following PRs.

Changes to Users

None

Checklist

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

@willyborn willyborn changed the title Fixes sub array (opencl, oneapi) support for reduce by key Fixes sub-array (opencl, oneapi) support for reduce by key Jun 14, 2025
@syurkevi syurkevi requested a review from edwinsolisf June 24, 2025 20:43
Revert line breaks. While these lines are quite long, introducing more breaks here makes it more difficult to read.
@christophe-murphy christophe-murphy merged commit eaa49ca into arrayfire:master Jun 27, 2025
1 of 4 checks passed
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.

2 participants