Skip to content

Commit ceccf59

Browse files
Merge pull request #387 from KristofferC/kc/requires
correct Requires usage to fix issues with PackageCompiler sysimages
2 parents 0f7691c + 9bbde83 commit ceccf59

6 files changed

+49
-19
lines changed

ext/ArrayInterfaceBandedMatricesExt.jl

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,16 @@
11
module ArrayInterfaceBandedMatricesExt
22

3-
using ArrayInterface
4-
using ArrayInterface: BandedMatrixIndex
5-
isdefined(Base, :get_extension) ? (using BandedMatrices) : (using ..BandedMatrices)
3+
4+
if isdefined(Base, :get_extension)
5+
using ArrayInterface
6+
using ArrayInterface: BandedMatrixIndex
7+
using BandedMatrices
8+
else
9+
using ..ArrayInterface
10+
using ..ArrayInterface: BandedMatrixIndex
11+
using ..BandedMatrices
12+
end
13+
614

715
Base.firstindex(i::BandedMatrixIndex) = 1
816
Base.lastindex(i::BandedMatrixIndex) = i.count

ext/ArrayInterfaceBlockBandedMatricesExt.jl

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
module ArrayInterfaceBlockBandedMatricesExt
22

3-
using ArrayInterface
4-
using ArrayInterface: BandedMatrixIndex
53

6-
if isdefined(Base, :get_extension)
4+
5+
if isdefined(Base, :get_extension)
6+
using ArrayInterface
7+
using ArrayInterface: BandedMatrixIndex
78
using BlockBandedMatrices
89
using BlockBandedMatrices.BlockArrays
910
else
11+
using ..ArrayInterface
12+
using ..ArrayInterface: BandedMatrixIndex
1013
using ..BlockBandedMatrices
1114
using ..BlockBandedMatrices.BlockArrays
1215
end

ext/ArrayInterfaceCUDAExt.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@ module ArrayInterfaceCUDAExt
22

33
using ArrayInterface
44

5-
if isdefined(Base, :get_extension)
5+
if isdefined(Base, :get_extension)
66
using CUDA
77
using CUDA.CUSOLVER
8-
else
8+
using LinearAlgebra
9+
else
910
using ..CUDA
1011
using ..CUDA.CUSOLVER
12+
using ..LinearAlgebra
1113
end
1214

13-
using LinearAlgebra
14-
1515
function ArrayInterface.lu_instance(A::CuMatrix{T}) where {T}
1616
if VERSION >= v"1.8-"
1717
ipiv = cu(Vector{Int32}(undef, 0))

ext/ArrayInterfaceGPUArraysCoreExt.jl

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,17 @@
11
module ArrayInterfaceGPUArraysCoreExt
22

3-
using Adapt
4-
using ArrayInterface
5-
using LinearAlgebra: lu
6-
isdefined(Base, :get_extension) ? (import GPUArraysCore) : (import ..GPUArraysCore)
3+
4+
if isdefined(Base, :get_extension)
5+
using Adapt
6+
using ArrayInterface
7+
using LinearAlgebra: lu
8+
import GPUArraysCore
9+
else
10+
using Adapt # Will cause problems for relocatability.
11+
using ..ArrayInterface
12+
using ..LinearAlgebra: lu
13+
import ..GPUArraysCore
14+
end
715

816
ArrayInterface.fast_scalar_indexing(::Type{<:GPUArraysCore.AbstractGPUArray}) = false
917
@inline ArrayInterface.allowed_getindex(x::GPUArraysCore.AbstractGPUArray, i...) = GPUArraysCore.@allowscalar(x[i...])

ext/ArrayInterfaceStaticArraysCoreExt.jl

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
module ArrayInterfaceStaticArraysCoreExt
22

3-
import ArrayInterface
4-
using LinearAlgebra
5-
isdefined(Base, :get_extension) ? (import StaticArraysCore) : (import ..StaticArraysCore)
3+
if isdefined(Base, :get_extension)
4+
import ArrayInterface
5+
using LinearAlgebra
6+
import StaticArraysCore
7+
else
8+
import ..ArrayInterface
9+
using ..LinearAlgebra
10+
import ..StaticArraysCore
11+
end
612

713
function ArrayInterface.undefmatrix(::StaticArraysCore.MArray{S, T, N, L}) where {S, T, N, L}
814
return StaticArraysCore.MMatrix{L, L, T, L*L}(undef)

ext/ArrayInterfaceTrackerExt.jl

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
module ArrayInterfaceTrackerExt
22

3-
using ArrayInterface
4-
isdefined(Base, :get_extension) ? (import Tracker) : (import ..Tracker)
3+
if isdefined(Base, :get_extension)
4+
using ArrayInterface
5+
import Tracker
6+
else
7+
using ..ArrayInterface
8+
import ..Tracker
9+
end
510

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

0 commit comments

Comments
 (0)