Skip to content

Support scalar on rank-0 GPU arrays - #244

Merged
mtfishman merged 2 commits into
mainfrom
gpu-scalar
Oct 19, 2026
Merged

mtfishman merged 2 commits into
mainfrom
gpu-scalar

Conversation

@jack-dunham

Copy link
Copy Markdown
Contributor

scalar(a) = a[] is a scalar index, which GPU array packages disallow, so reading the result of a full contraction of CuArrays threw. A GPUArraysCore extension adds scalar(a::AnyGPUArray{<:Any, 0}) = @allowscalar a[], which copies the element to the host; other arrays keep the generic a[]. Bump the version to 0.23.3.

`scalar(a) = a[]` is a scalar index, which GPU array packages disallow, so reading the
result of a full contraction of `CuArray`s threw. A `GPUArraysCore` extension adds
`scalar(a::AnyGPUArray{<:Any, 0}) = @allowscalar a[]`, which copies the element to the
host; other arrays keep the generic `a[]`. Bump the version to 0.23.3.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ITensorBot

ITensorBot commented Oct 19, 2026 •

Copy link
Copy Markdown
Member

Your PR no longer requires formatting changes. Thank you for your contribution!

@codecov

codecov Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.83%. Comparing base (ab47698) to head (8efd57b).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #244      +/-   ##
==========================================
+ Coverage   83.81%   83.83%   +0.01%     
==========================================
  Files          30       31       +1     
  Lines         970      971       +1     
==========================================
+ Hits          813      814       +1     
  Misses        157      157              
Flag Coverage Δ
docs 25.64% <0.00%> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 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.

@mtfishman
mtfishman enabled auto-merge (squash) October 19, 2026 16:50
@mtfishman
mtfishman merged commit f25bff9 into main Oct 19, 2026
26 of 28 checks passed
@mtfishman
mtfishman deleted the gpu-scalar branch October 19, 2026 16:58
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