Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions ext/ArrayInterfaceCUDAExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,9 @@ using CUDA.CUSOLVER
using LinearAlgebra

function ArrayInterface.lu_instance(A::CuMatrix{T}) where {T}
if VERSION >= v"1.8-"
ipiv = cu(Vector{Int32}(undef, 0))
info = zero(Int)
return LinearAlgebra.LU(similar(A, 0, 0), ipiv, info)
else
LinearAlgebra.lu(A; check = false)
end
ipiv = cu(Vector{Int32}(undef, 0))
info = zero(Int)
return LinearAlgebra.LU(similar(A, 0, 0), ipiv, info)
end

ArrayInterface.device(::Type{<:CUDA.CuArray}) = ArrayInterface.GPU()
Expand Down
14 changes: 1 addition & 13 deletions src/ArrayInterface.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,7 @@ module ArrayInterface

using LinearAlgebra

@static if isdefined(Base, Symbol("@assume_effects"))
using Base: @assume_effects
else
macro assume_effects(args...)
n = nfields(args)
call = getfield(args, n)
if n === 2 && getfield(args, 1) === QuoteNode(:total)
return esc(:(Base.@pure $(call)))
else
return esc(call)
end
end
end
using Base: @assume_effects
@assume_effects :total __parameterless_type(T)=Base.typename(T).wrapper
parameterless_type(x) = parameterless_type(typeof(x))
parameterless_type(x::Type) = __parameterless_type(x)
Expand Down
1 change: 1 addition & 0 deletions test/bandedmatrices.jl
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ rowind, colind = ArrayInterface.findstructralnz(B)
@test ArrayInterface.fast_matrix_colors(typeof(B))

for op in (adjoint, transpose)
local B
B = BandedMatrix(Ones(5, 5), (-1, 2))
B[band(1)] .= [1, 2, 3, 4]
B[band(2)] .= [5, 6, 7]
Expand Down
10 changes: 2 additions & 8 deletions test/core.jl
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,7 @@ end

@testset "fast_scalar_indexing" begin
@test !fast_scalar_indexing(qr(rand(10, 10)).Q)
if VERSION >= v"1.7"
@test !fast_scalar_indexing(qr(rand(10, 10), ColumnNorm()).Q)
else
@test !fast_scalar_indexing(qr(rand(10, 10), Val(true)).Q)
end
@test !fast_scalar_indexing(qr(rand(10, 10), ColumnNorm()).Q)
@test !fast_scalar_indexing(lq(rand(10, 10)).Q)
@test fast_scalar_indexing(Nothing) # test default
end
Expand Down Expand Up @@ -285,9 +281,7 @@ end
for A in [sparse([1.0 2.0; 3.0 4.0])]
@test ArrayInterface.lu_instance(A) isa typeof(lu(A))
@test ArrayInterface.qr_instance(A) isa typeof(qr(A))
if VERSION >= v"1.9-"
@test ArrayInterface.cholesky_instance(A' * A) isa typeof(cholesky(A' * A))
end
@test ArrayInterface.cholesky_instance(A' * A) isa typeof(cholesky(A' * A))
@test ArrayInterface.ldlt_instance(SymTridiagonal(A' * A)) isa typeof(ldlt(SymTridiagonal(A' * A)))
end
end
Expand Down
Loading