Skip to content

Commit 341b28a

Browse files
re-arrange tests to test all subpackages locally and pass
1 parent 086cd5a commit 341b28a

File tree

30 files changed

+1033
-1064
lines changed

30 files changed

+1033
-1064
lines changed

Project.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,9 @@ IfElse = "0.1"
1616
Static = "0.6"
1717
julia = "1.6"
1818

19+
[extras]
20+
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
21+
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
22+
23+
[targets]
24+
test = ["Pkg", "Test"]

lib/ArrayInterfaceBandedMatrices/Project.toml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,7 @@ BandedMatrices = "0.17"
1212
julia = "1.6"
1313

1414
[extras]
15-
ArrayInterfaceCore = "30b0a656-2188-435a-8636-2ec0e6a096e2"
16-
BandedMatrices = "aae01518-5342-5314-be14-df237901396f"
1715
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
1816

1917
[targets]
20-
test = ["ArrayInterfaceCore","BandedMatrices","Test"]
18+
test = ["Test"]

lib/ArrayInterfaceBandedMatrices/src/ArrayInterfaceBandedMatrices.jl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ module ArrayInterfaceBandedMatrices
33
using ArrayInterfaceCore
44
using BandedMatrices
55

6-
const CanonicalInt = Union{Int,StaticInt}
7-
86
struct BandedMatrixIndex <: ArrayInterfaceCore.MatrixIndex
97
count::Int
108
rowsize::Int

lib/ArrayInterfaceBlockBandedMatrices/Project.toml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,7 @@ BlockArrays = "0.16"
1717
julia = "1.6"
1818

1919
[extras]
20-
ArrayInterfaceCore = "30b0a656-2188-435a-8636-2ec0e6a096e2"
21-
BlockArrays = "8e7c35d0-a365-5155-bbbb-fb81a777f24e"
22-
BlockBandedMatrices = "ffab5731-97b5-5995-9138-79e8c1846df0"
2320
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
2421

2522
[targets]
26-
test = ["ArrayInterfaceCore","BlockArrays","BlockBandedMatrices","Test"]
23+
test = ["Test"]

lib/ArrayInterfaceBlockBandedMatrices/src/ArrayInterfaceBlockBandedMatrices.jl

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

8-
const CanonicalInt = Union{Int,StaticInt}
9-
108
struct BlockBandedMatrixIndex <: ArrayInterfaceCore.MatrixIndex
119
count::Int
1210
refinds::Array{Int,1}

lib/ArrayInterfaceCUDA/src/ArrayInterfaceCUDA.jl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ using Adapt
44
using ArrayInterface
55
using CUDA
66

7-
const CanonicalInt = Union{Int,StaticInt}
8-
97
ArrayInterface.fast_scalar_indexing(::Type{<:CUDA.CuArray}) = false
108
@inline ArrayInterface.allowed_getindex(x::CUDA.CuArray, i...) = CUDA.@allowscalar(x[i...])
119
@inline ArrayInterface.allowed_setindex!(x::CUDA.CuArray, v, i...) = (CUDA.@allowscalar(x[i...] = v))

lib/ArrayInterfaceCore/src/ArrayInterfaceCore.jl

Lines changed: 0 additions & 155 deletions
Original file line numberDiff line numberDiff line change
@@ -40,16 +40,6 @@ parent_type(::Type{T}) where {T} = T
4040
parent_type(::Type{R}) where {S,T,A,N,R<:Base.ReinterpretArray{T,N,S,A}} = A
4141
parent_type(::Type{Diagonal{T,V}}) where {T,V} = V
4242

43-
"""
44-
has_parent(::Type{T}) -> StaticBool
45-
46-
Returns `static(true)` if `parent_type(T)` a type unique to `T`.
47-
"""
48-
has_parent(x) = has_parent(typeof(x))
49-
has_parent(::Type{T}) where {T} = _has_parent(parent_type(T), T)
50-
_has_parent(::Type{T}, ::Type{T}) where {T} = False()
51-
_has_parent(::Type{T1}, ::Type{T2}) where {T1,T2} = True()
52-
5343
"""
5444
buffer(x)
5545
@@ -370,151 +360,6 @@ end
370360
"""
371361
can_avx(::Any) = false
372362

373-
"""
374-
insert(collection, index, item)
375-
376-
Returns a new instance of `collection` with `item` inserted into at the given `index`.
377-
"""
378-
Base.@propagate_inbounds function insert(collection, index, item)
379-
@boundscheck checkbounds(collection, index)
380-
ret = similar(collection, length(collection) + 1)
381-
@inbounds for i = firstindex(ret):(index-1)
382-
ret[i] = collection[i]
383-
end
384-
@inbounds ret[index] = item
385-
@inbounds for i = (index+1):lastindex(ret)
386-
ret[i] = collection[i-1]
387-
end
388-
return ret
389-
end
390-
391-
function insert(x::Tuple{Vararg{Any,N}}, index::Integer, item) where {N}
392-
@boundscheck if !checkindex(Bool, StaticInt{1}():StaticInt{N}(), index)
393-
throw(BoundsError(x, index))
394-
end
395-
return unsafe_insert(x, Int(index), item)
396-
end
397-
398-
@inline function unsafe_insert(x::Tuple, i::Int, item)
399-
if i === 1
400-
return (item, x...)
401-
else
402-
return (first(x), unsafe_insert(tail(x), i - 1, item)...)
403-
end
404-
end
405-
406-
"""
407-
deleteat(collection, index)
408-
409-
Returns a new instance of `collection` with the item at the given `index` removed.
410-
"""
411-
Base.@propagate_inbounds function deleteat(collection::AbstractVector, index)
412-
@boundscheck if !checkindex(Bool, eachindex(collection), index)
413-
throw(BoundsError(collection, index))
414-
end
415-
return unsafe_deleteat(collection, index)
416-
end
417-
Base.@propagate_inbounds function deleteat(collection::Tuple{Vararg{Any,N}}, index) where {N}
418-
@boundscheck if !checkindex(Bool, StaticInt{1}():StaticInt{N}(), index)
419-
throw(BoundsError(collection, index))
420-
end
421-
return unsafe_deleteat(collection, index)
422-
end
423-
424-
function unsafe_deleteat(src::AbstractVector, index::Integer)
425-
dst = similar(src, length(src) - 1)
426-
@inbounds for i in indices(dst)
427-
if i < index
428-
dst[i] = src[i]
429-
else
430-
dst[i] = src[i+1]
431-
end
432-
end
433-
return dst
434-
end
435-
436-
@inline function unsafe_deleteat(src::AbstractVector, inds::AbstractVector)
437-
dst = similar(src, length(src) - length(inds))
438-
dst_index = firstindex(dst)
439-
@inbounds for src_index in indices(src)
440-
if !in(src_index, inds)
441-
dst[dst_index] = src[src_index]
442-
dst_index += one(dst_index)
443-
end
444-
end
445-
return dst
446-
end
447-
448-
@inline function unsafe_deleteat(src::Tuple, inds::AbstractVector)
449-
dst = Vector{eltype(src)}(undef, length(src) - length(inds))
450-
dst_index = firstindex(dst)
451-
@inbounds for src_index in OneTo(length(src))
452-
if !in(src_index, inds)
453-
dst[dst_index] = src[src_index]
454-
dst_index += one(dst_index)
455-
end
456-
end
457-
return Tuple(dst)
458-
end
459-
460-
@inline unsafe_deleteat(x::Tuple{T}, i::Integer) where {T} = ()
461-
@inline unsafe_deleteat(x::Tuple{T1,T2}, i::Integer) where {T1,T2} =
462-
isone(i) ? (x[2],) : (x[1],)
463-
@inline function unsafe_deleteat(x::Tuple, i::Integer)
464-
if i === one(i)
465-
return tail(x)
466-
elseif i == length(x)
467-
return Base.front(x)
468-
else
469-
return (first(x), unsafe_deleteat(tail(x), i - one(i))...)
470-
end
471-
end
472-
473-
"""
474-
is_lazy_conjugate(::AbstractArray) -> Bool
475-
476-
Determine if a given array will lazyily take complex conjugates, such as with `Adjoint`. This will work with
477-
nested wrappers, so long as there is no type in the chain of wrappers such that `parent_type(T) == T`
478-
479-
Examples
480-
481-
julia> a = transpose([1 + im, 1-im]')
482-
2×1 transpose(adjoint(::Vector{Complex{Int64}})) with eltype Complex{Int64}:
483-
1 - 1im
484-
1 + 1im
485-
486-
julia> ArrayInterfaceCore.is_lazy_conjugate(a)
487-
True()
488-
489-
julia> b = a'
490-
1×2 adjoint(transpose(adjoint(::Vector{Complex{Int64}}))) with eltype Complex{Int64}:
491-
1+1im 1-1im
492-
493-
julia> ArrayInterfaceCore.is_lazy_conjugate(b)
494-
False()
495-
496-
"""
497-
is_lazy_conjugate(::T) where {T<:AbstractArray} = _is_lazy_conjugate(T, False())
498-
is_lazy_conjugate(::AbstractArray{<:Real}) = False()
499-
500-
function _is_lazy_conjugate(::Type{T}, isconj) where {T<:AbstractArray}
501-
Tp = parent_type(T)
502-
if T !== Tp
503-
_is_lazy_conjugate(Tp, isconj)
504-
else
505-
isconj
506-
end
507-
end
508-
509-
function _is_lazy_conjugate(::Type{T}, isconj) where {T<:Adjoint}
510-
Tp = parent_type(T)
511-
if T !== Tp
512-
_is_lazy_conjugate(Tp, !isconj)
513-
else
514-
!isconj
515-
end
516-
end
517-
518363
"""
519364
fast_scalar_indexing(::Type{T}) -> Bool
520365

0 commit comments

Comments
 (0)