Skip to content

fix(oneapi): account for indexed subarray offset - #3737

Open
dajiaohuang wants to merge 1 commit into
arrayfire:masterfrom
dajiaohuang:fix/3733-oneapi-subarray-index-offset
Open

dajiaohuang wants to merge 1 commit into
arrayfire:masterfrom
dajiaohuang:fix/3733-oneapi-subarray-index-offset

Conversation

@dajiaohuang

Copy link
Copy Markdown

Fixes #3733.

Description

The oneAPI index kernel reads from the underlying buffer using view-relative indices but omits Param::offset. Indexing a non-zero-offset subarray with an index array therefore reads from the beginning of the parent array. Include the input buffer offset when calculating the source pointer, and add a regression test for indexing a slice with indices {0, 1, 2, 3}.

Validation

git diff --check passed. The ArrayFire test/build suite was not run: this environment has no CMake or C++ compiler/SYCL toolchain, and the assigned task prohibits using real GPU hardware. The regression test is committed for execution by the project’s backend test setup.

Changes to Users

None; this restores the documented view-relative indexing behavior.

Checklist

  • Rebased on latest master
  • Code compiles (not run: toolchain unavailable)
  • Tests pass (not run: toolchain unavailable; oneAPI hardware prohibited)
  • Functions added to unified API (N/A)
  • Functions documented (N/A)

This branch has not been deployed

No deployments
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] oneAPI: indexing a slice with an index array ignores the slice's offset

1 participant