Skip to content

Generalize norm and normalize to AnyGPUArray.#720

Merged
maleadt merged 1 commit into
mainfrom
tb/norm_any
May 15, 2026
Merged

Generalize norm and normalize to AnyGPUArray.#720
maleadt merged 1 commit into
mainfrom
tb/norm_any

Conversation

@maleadt
Copy link
Copy Markdown
Member

@maleadt maleadt commented May 15, 2026

Lets norm/normalize short-circuit the LinearAlgebra dispatch for SubArrays/wrappers of GPU arrays, which would otherwise fall back to norm_recursive_check (Julia 1.12+) or generic_norm2, both of which iterate and trigger scalar indexing.

Lets `norm`/`normalize` short-circuit the LinearAlgebra dispatch for
SubArrays/wrappers of GPU arrays, which would otherwise fall back to
`norm_recursive_check` (Julia 1.12+) or `generic_norm2`, both of which
iterate and trigger scalar indexing.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@kshyatt
Copy link
Copy Markdown
Member

kshyatt commented May 15, 2026

Does this also cover norm(v::Broadcasted{<:GPUArrayStyle}, p) 👀

@maleadt
Copy link
Copy Markdown
Member Author

maleadt commented May 15, 2026

No, that's not covered by Adapt's WrappedArray.

@maleadt maleadt merged commit 9e003f8 into main May 15, 2026
17 of 18 checks passed
@maleadt maleadt deleted the tb/norm_any branch May 15, 2026 11:48
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