Skip to content

Commit 5a0ac20

Browse files
fix requires usage
1 parent 6a0fddb commit 5a0ac20

8 files changed

+45
-16
lines changed

ext/ArrayInterfaceBandedMatricesExt.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ module ArrayInterfaceBandedMatricesExt
22

33
using ArrayInterface
44
using ArrayInterface: BandedMatrixIndex
5-
using BandedMatrices
5+
isdefined(Base, :get_extension) ? (using BandedMatrices) : (using ..BandedMatrices)
66

77
Base.firstindex(i::BandedMatrixIndex) = 1
88
Base.lastindex(i::BandedMatrixIndex) = i.count

ext/ArrayInterfaceBlockBandedMatricesExt.jl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,14 @@ using ArrayInterface: BandedMatrixIndex
55
using BlockBandedMatrices
66
using BlockBandedMatrices.BlockArrays
77

8+
if isdefined(Base, :get_extension)
9+
using BlockBandedMatrices
10+
using BlockBandedMatrices.BlockArrays
11+
else
12+
using ..BlockBandedMatrices
13+
using ..BlockBandedMatrices.BlockArrays
14+
end
15+
816
struct BlockBandedMatrixIndex <: ArrayInterface.MatrixIndex
917
count::Int
1018
refinds::Array{Int,1}

ext/ArrayInterfaceCUDAExt.jl

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

33
using Adapt
44
using ArrayInterface
5-
using CUDA
6-
using CUDA.CUSOLVER
5+
6+
if isdefined(Base, :get_extension)
7+
using CUDA
8+
using CUDA.CUSOLVER
9+
else
10+
using ..CUDA
11+
using ..CUDA.CUSOLVER
12+
end
713

814
using LinearAlgebra
915

ext/ArrayInterfaceGPUArraysCoreExt.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ module ArrayInterfaceGPUArraysExt
22

33
using Adapt
44
using ArrayInterface
5-
using GPUArraysCore
65
using LinearAlgebra: lu
6+
isdefined(Base, :get_extension) ? (import GPUArraysCore) : (import ..GPUArraysCore)
77

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

ext/ArrayInterfaceStaticArraysCoreExt.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
module ArrayInterfaceStaticArraysCoreExt
22

3-
import StaticArraysCore, ArrayInterface, Adapt
3+
import ArrayInterface, Adapt
44
using LinearAlgebra
5+
isdefined(Base, :get_extension) ? (import StaticArraysCore) : (import ..StaticArraysCore)
56

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

ext/ArrayInterfaceStaticArraysExt.jl

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,15 @@ module ArrayInterfaceStaticArraysExt
33
using Adapt
44
using ArrayInterface
55
using LinearAlgebra
6-
using StaticArrays
7-
using Static
8-
using Static: StaticInt
6+
if isdefined(Base, :get_extension)
7+
using StaticArrays
8+
using Static
9+
using Static: StaticInt
10+
else
11+
using ..StaticArrays
12+
using ..Static
13+
using ..Static: StaticInt
14+
end
915

1016
const CanonicalInt = Union{Int,StaticInt}
1117

ext/ArrayInterfaceStaticExt.jl

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,21 @@ contiguous_axis_indicator, is_column_major, _all_dense, AbstractArray2, dimnames
3232
to_axes, find_all_dimnames, to_dims, known_size, deleteat, insert, static_size, is_lazy_conjugate, static_stride, static_strides, has_dimnames, unsafe_reconstruct, static_to_indices,
3333
to_index, unsafe_setindex!, unsafe_getindex, static_axes, to_axis, is_dense, static_getindex
3434

35-
using Static
36-
using Static: Zero, One, nstatic, eq, ne, gt, ge, lt, le, eachop, eachop_tuple,
37-
permute, invariant_permutation, field_type, reduce_tup, find_first_eq,
38-
OptionallyStaticUnitRange, OptionallyStaticStepRange, OptionallyStaticRange,
39-
IntType,
40-
SOneTo, SUnitRange
41-
35+
if isdefined(Base, :get_extension)
36+
using Static
37+
using Static: Zero, One, nstatic, eq, ne, gt, ge, lt, le, eachop, eachop_tuple,
38+
permute, invariant_permutation, field_type, reduce_tup, find_first_eq,
39+
OptionallyStaticUnitRange, OptionallyStaticStepRange, OptionallyStaticRange,
40+
IntType,
41+
SOneTo, SUnitRange
42+
else
43+
using ..Static
44+
using ..Static: Zero, One, nstatic, eq, ne, gt, ge, lt, le, eachop, eachop_tuple,
45+
permute, invariant_permutation, field_type, reduce_tup, find_first_eq,
46+
OptionallyStaticUnitRange, OptionallyStaticStepRange, OptionallyStaticRange,
47+
IntType,
48+
SOneTo, SUnitRange
49+
end
4250
using IfElse
4351

4452
using Base.Cartesian

ext/ArrayInterfaceTrackerExt.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module ArrayInterfaceTrackerExt
22

33
using ArrayInterface
4-
using Tracker
4+
isdefined(Base, :get_extension) ? (import Tracker) : (import ..Tracker)
55

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

0 commit comments

Comments
 (0)