Skip to content

Conversation

mtfishman
Copy link
Contributor

@mtfishman mtfishman commented Jul 3, 2025

Currently, sub_materialize (through sub_materialize_axes) falls back to materializing on CPU. This PR generalizes that logic by determining the output destination with similar, which helps to support non-Array types like GPU arrays. As a stand-in for other GPU arrays, I test this using JLArrays.JLArray, which is a reference implementation for the GPUArrays.jl interface that runs on CPU.

An alternative design would be to define memory layouts for GPU arrays (i.e. #9), which would allow more customizability for GPU array backends, however I think it is helpful to have fallbacks that "just work" if reasonable parts of the Base AbstractArray interface are implemented.

I hit this issue because I was testing out BlockArrays.BlockedArray wrapping a GPU array and noticed that calling A[Block(1, 1)] to access a block instantiated the block on CPU, this PR fixes that issue.

Copy link

codecov bot commented Jul 3, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.52%. Comparing base (b9b424e) to head (fa93860).
⚠️ Report is 5 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #261   +/-   ##
=======================================
  Coverage   89.52%   89.52%           
=======================================
  Files          11       11           
  Lines        1938     1938           
=======================================
  Hits         1735     1735           
  Misses        203      203           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@dlfivefifty dlfivefifty merged commit 255e4ce into JuliaLinearAlgebra:master Oct 6, 2025
17 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.

3 participants