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
14 changes: 11 additions & 3 deletions ext/ArrayInterfaceBandedMatricesExt.jl
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
module ArrayInterfaceBandedMatricesExt

using ArrayInterface
using ArrayInterface: BandedMatrixIndex
isdefined(Base, :get_extension) ? (using BandedMatrices) : (using ..BandedMatrices)

if isdefined(Base, :get_extension)
using ArrayInterface
using ArrayInterface: BandedMatrixIndex
using BandedMatrices
else
using ..ArrayInterface
using ..ArrayInterface: BandedMatrixIndex
using ..BandedMatrices
end


Base.firstindex(i::BandedMatrixIndex) = 1
Base.lastindex(i::BandedMatrixIndex) = i.count
Expand Down
9 changes: 6 additions & 3 deletions ext/ArrayInterfaceBlockBandedMatricesExt.jl
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
module ArrayInterfaceBlockBandedMatricesExt

using ArrayInterface
using ArrayInterface: BandedMatrixIndex

if isdefined(Base, :get_extension)

if isdefined(Base, :get_extension)
using ArrayInterface
using ArrayInterface: BandedMatrixIndex
using BlockBandedMatrices
using BlockBandedMatrices.BlockArrays
else
using ..ArrayInterface
using ..ArrayInterface: BandedMatrixIndex
using ..BlockBandedMatrices
using ..BlockBandedMatrices.BlockArrays
end
Expand Down
8 changes: 4 additions & 4 deletions ext/ArrayInterfaceCUDAExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@ module ArrayInterfaceCUDAExt

using ArrayInterface

if isdefined(Base, :get_extension)
if isdefined(Base, :get_extension)
using CUDA
using CUDA.CUSOLVER
else
using LinearAlgebra
else
using ..CUDA
using ..CUDA.CUSOLVER
using ..LinearAlgebra
end

using LinearAlgebra

function ArrayInterface.lu_instance(A::CuMatrix{T}) where {T}
if VERSION >= v"1.8-"
ipiv = cu(Vector{Int32}(undef, 0))
Expand Down
16 changes: 12 additions & 4 deletions ext/ArrayInterfaceGPUArraysCoreExt.jl
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
module ArrayInterfaceGPUArraysCoreExt

using Adapt
using ArrayInterface
using LinearAlgebra: lu
isdefined(Base, :get_extension) ? (import GPUArraysCore) : (import ..GPUArraysCore)

if isdefined(Base, :get_extension)
using Adapt
using ArrayInterface
using LinearAlgebra: lu
import GPUArraysCore
else
using Adapt # Will cause problems for relocatability.
using ..ArrayInterface
using ..LinearAlgebra: lu
import ..GPUArraysCore
end

ArrayInterface.fast_scalar_indexing(::Type{<:GPUArraysCore.AbstractGPUArray}) = false
@inline ArrayInterface.allowed_getindex(x::GPUArraysCore.AbstractGPUArray, i...) = GPUArraysCore.@allowscalar(x[i...])
Expand Down
12 changes: 9 additions & 3 deletions ext/ArrayInterfaceStaticArraysCoreExt.jl
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
module ArrayInterfaceStaticArraysCoreExt

import ArrayInterface
using LinearAlgebra
isdefined(Base, :get_extension) ? (import StaticArraysCore) : (import ..StaticArraysCore)
if isdefined(Base, :get_extension)
import ArrayInterface
using LinearAlgebra
import StaticArraysCore
else
import ..ArrayInterface
using ..LinearAlgebra
import ..StaticArraysCore
end

function ArrayInterface.undefmatrix(::StaticArraysCore.MArray{S, T, N, L}) where {S, T, N, L}
return StaticArraysCore.MMatrix{L, L, T, L*L}(undef)
Expand Down
9 changes: 7 additions & 2 deletions ext/ArrayInterfaceTrackerExt.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
module ArrayInterfaceTrackerExt

using ArrayInterface
isdefined(Base, :get_extension) ? (import Tracker) : (import ..Tracker)
if isdefined(Base, :get_extension)
using ArrayInterface
import Tracker
else
using ..ArrayInterface
import ..Tracker
end

ArrayInterface.ismutable(::Type{<:Tracker.TrackedArray}) = false
ArrayInterface.ismutable(T::Type{<:Tracker.TrackedReal}) = false
Expand Down