Skip to content

JLArrays: Disallow conversions to CPU pointers. - #549

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

JLArrays: Disallow conversions to CPU pointers.#549
maleadt merged 1 commit into
mainfrom
tb/jlarray_ptr

Conversation

@maleadt

@maleadt maleadt commented Jul 5, 2024

Copy link
Copy Markdown
Member

This helps flush out uses of unsupported functionality.

Noticed in #458, where a call to qr(::JLArray) dispatched to LAPACK.geqrt! without erroring.

@maleadt
maleadt marked this pull request as draft July 5, 2024 11:32
Helps flush out uses of unsupported functionality, e.g. a call to
`qr(::JLArray)` that would dispatch to `LAPACK.geqrt!` without erroring.

`Base.pointer` remains available for callers that explicitly want a
pointer; the guard lives on `Base.unsafe_convert`, which is what ccall
routes through.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@maleadt
maleadt marked this pull request as ready for review May 15, 2026 14:09
@maleadt
maleadt merged commit 00f6243 into main May 15, 2026
17 of 18 checks passed
@maleadt
maleadt deleted the tb/jlarray_ptr branch May 15, 2026 15:40
ChrisRackauckas added a commit to SciML/LinearSolve.jl that referenced this pull request Aug 8, 2026
…requires (#1155)

JLArrays 0.3.2 (JuliaGPU/GPUArrays.jl#549) makes unsafe_convert(Ptr, ::JLArray)
throw, so the stdlib LAPACK lu that LUFactorization fell through to on JLArray
now errors with 'Illegal conversion of a JLArray to a Ptr' instead of silently
factorizing the CPU-backed buffer. JLArray ships no native lu (real GPU
backends get theirs from CUSOLVER etc.), so an LU algorithm can never satisfy
the GPU contract this file exists to prove. Solve the device problems with
KrylovJL_GMRES at tight tolerances instead; the split-Dual machinery under
test is algorithm-agnostic and still reproduces the CPU LU reference to 1e-12.

Co-authored-by: Chris Rackauckas <accounts@chrisrackauckas.com>
christiangnrd added a commit that referenced this pull request Aug 25, 2026
christiangnrd added a commit that referenced this pull request Aug 25, 2026
maleadt pushed a commit that referenced this pull request Aug 26, 2026
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.

1 participant