Skip to content

Commit 1b3fbe4

Browse files
committed
Specialize lu_instance for CuArray and add generic fallback
1 parent 2e6b73b commit 1b3fbe4

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/ArrayInterface.jl

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -420,6 +420,13 @@ Return the number.
420420
"""
421421
lu_instance(a::Number) = a
422422

423+
"""
424+
lu_instance(a::Any) -> lu(a, check=false)
425+
426+
Return the number.
427+
"""
428+
lu_instance(a::Any) = lu(a, check=false)
429+
423430
"""
424431
safevec(v)
425432
@@ -520,6 +527,10 @@ function __init__()
520527
@require Adapt="79e6a3ab-5dfb-504d-930d-738a2a938a0e" begin
521528
include("cuarrays.jl")
522529
end
530+
@require DiffEqBase="2b5f629d-d688-5b77-993f-72d75c75574e" begin
531+
# actually do QR
532+
lu_instance(A::CuArrays.CuMatrix{T}) where T = CuArrays.CUSOLVER.CuQR(similar(A, 0, 0), similar(A, 0))
533+
end
523534
end
524535

525536
@require BandedMatrices="aae01518-5342-5314-be14-df237901396f" begin

0 commit comments

Comments
 (0)