diff --git a/ext/ArrayInterfaceCUDAExt.jl b/ext/ArrayInterfaceCUDAExt.jl index ae4477d3..4febac2e 100644 --- a/ext/ArrayInterfaceCUDAExt.jl +++ b/ext/ArrayInterfaceCUDAExt.jl @@ -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() diff --git a/src/ArrayInterface.jl b/src/ArrayInterface.jl index 52b1066b..05231120 100644 --- a/src/ArrayInterface.jl +++ b/src/ArrayInterface.jl @@ -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) diff --git a/test/bandedmatrices.jl b/test/bandedmatrices.jl index 94626aac..d1c1cd2b 100644 --- a/test/bandedmatrices.jl +++ b/test/bandedmatrices.jl @@ -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] diff --git a/test/core.jl b/test/core.jl index 003f7b5d..62cabf88 100644 --- a/test/core.jl +++ b/test/core.jl @@ -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 @@ -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