Skip to content

Commit 21a56f3

Browse files
Merge pull request #266 from JuliaArrays/core
Make ArrayInterfaceCore lean
2 parents fb96f6f + e36f9e5 commit 21a56f3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+1801
-1924
lines changed

.ci/test.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ import Pkg
33
const GROUP = get(ENV, "GROUP", "All")
44

55
function dev_subpkg(subpkg)
6-
subpkg_path = joinpath(dirname(@__DIR__), "lib", subpkg)
6+
subpkg_path = joinpath("lib", subpkg)
77
Pkg.develop(Pkg.PackageSpec(path=subpkg_path))
88
end
99

1010
function activate_subpkg_env(subpkg)
11-
subpkg_path = joinpath(dirname(@__DIR__), "lib", subpkg)
11+
subpkg_path = joinpath("lib", subpkg)
1212
Pkg.activate(subpkg_path)
1313
Pkg.develop(Pkg.PackageSpec(path=subpkg_path))
1414
Pkg.instantiate()

.github/workflows/Downstream.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
run: |
4040
using Pkg
4141
function dev_subpkg(subpkg)
42-
subpkg_path = joinpath(".","ArrayInterface", "lib", subpkg)
42+
subpkg_path = joinpath("lib", subpkg)
4343
Pkg.develop(Pkg.PackageSpec(path=subpkg_path))
4444
end
4545
dev_subpkg("ArrayInterfaceCore")

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ jobs:
1313
fail-fast: false
1414
matrix:
1515
group:
16+
- ArrayInterface
1617
- ArrayInterfaceCore
1718
- ArrayInterfaceBandedMatrices
1819
- ArrayInterfaceBlockBandedMatrices

Project.toml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,24 @@
11
name = "ArrayInterface"
22
uuid = "4fba245c-0d91-5ea0-9b3e-6abc04ee57a9"
3-
version = "5.0.8"
3+
version = "5.1.0"
44

55
[deps]
66
ArrayInterfaceCore = "30b0a656-2188-435a-8636-2ec0e6a096e2"
7+
Compat = "34da2185-b29b-5c13-b0c7-acf172513d20"
8+
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
9+
IfElse = "615f187c-cbe4-4ef1-ba3b-2fcf58d6d173"
710
Static = "aedffcd0-7271-4cad-89d0-dc628f76c6d3"
811

912
[compat]
1013
ArrayInterfaceCore = "0.1"
14+
Compat = "3"
15+
IfElse = "0.1"
1116
Static = "0.6"
1217
julia = "1.6"
1318

19+
[extras]
20+
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
21+
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
22+
23+
[targets]
24+
test = ["Pkg", "Test"]
Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "ArrayInterfaceBandedMatrices"
22
uuid = "2e50d22c-5be1-4042-81b1-c572ed69783d"
3-
version = "0.1.0"
3+
version = "0.1.1"
44

55
[deps]
66
ArrayInterfaceCore = "30b0a656-2188-435a-8636-2ec0e6a096e2"
@@ -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/ArrayInterfaceBlockBandedMatrices/Project.toml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "ArrayInterfaceBlockBandedMatrices"
22
uuid = "5331f1e9-51c7-46b0-a9b0-df4434785e0a"
33
authors = ["Zachary P. Christensen <[email protected]>"]
4-
version = "0.1.0"
4+
version = "0.1.1"
55

66
[deps]
77
ArrayInterfaceCore = "30b0a656-2188-435a-8636-2ec0e6a096e2"
@@ -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: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ function BlockBandedMatrixIndex(nrowblock, ncolblock, rowsizes, colsizes, l, u)
1919
blockcolind = ArrayInterfaceBandedMatrices.BandedMatrixIndex(nrowblock, ncolblock, l, u, false)
2020
sortedinds = sort(
2121
[(blockrowind[i], blockcolind[i]) for i = 1:length(blockrowind)],
22-
by = x -> x[1],
22+
by=x -> x[1],
2323
)
24-
sort!(sortedinds, by = x -> x[2], alg = InsertionSort)# stable sort keeps the second index in order
24+
sort!(sortedinds, by=x -> x[2], alg=InsertionSort)# stable sort keeps the second index in order
2525
refinds = Array{Int,1}()
2626
refrowcoords = Array{Int,1}()
2727
refcolcoords = Array{Int,1}()
@@ -132,9 +132,9 @@ function BandedBlockBandedMatrixIndex(
132132
blockcolind = ArrayInterfaceBandedMatrices.BandedMatrixIndex(nrowblock, ncolblock, l, u, false)
133133
sortedinds = sort(
134134
[(blockrowind[i], blockcolind[i]) for i = 1:length(blockrowind)],
135-
by = x -> x[1],
135+
by=x -> x[1],
136136
)
137-
sort!(sortedinds, by = x -> x[2], alg = InsertionSort)# stable sort keeps the second index in order
137+
sort!(sortedinds, by=x -> x[2], alg=InsertionSort)# stable sort keeps the second index in order
138138
rowheights = pushfirst!(copy(rowsizes), 1)
139139
cumsum!(rowheights, rowheights)
140140
colwidths = pushfirst!(copy(colsizes), 1)
@@ -218,7 +218,7 @@ function ArrayInterfaceCore.matrix_colors(A::BlockBandedMatrices.BlockBandedMatr
218218
(startinds[blockcolors[i]]:endinds[blockcolors[i]])[1:cols[i]]
219219
for i = 1:nblock
220220
]
221-
return reduce(vcat,colors)
221+
return reduce(vcat, colors)
222222
end
223223

224224
function ArrayInterfaceCore.matrix_colors(A::BlockBandedMatrices.BandedBlockBandedMatrix)

lib/ArrayInterfaceCUDA/Project.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
name = "ArrayInterfaceCUDA"
22
uuid = "3e6d3b71-936e-4b08-8b74-7853fb4a8432"
33
authors = ["Zachary P. Christensen <[email protected]>"]
4-
version = "0.1.0"
4+
version = "0.1.1"
55

66
[deps]
77
Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"
8-
ArrayInterfaceCore = "30b0a656-2188-435a-8636-2ec0e6a096e2"
8+
ArrayInterface = "4fba245c-0d91-5ea0-9b3e-6abc04ee57a9"
99
CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba"
1010

1111
[compat]
1212
Adapt = "3"
13-
ArrayInterfaceCore = "0.1"
13+
ArrayInterface = "5"
1414
CUDA = "3.9"
1515
julia = "1.6"
1616

lib/ArrayInterfaceCUDA/src/ArrayInterfaceCUDA.jl

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
module ArrayInterfaceCUDA
22

33
using Adapt
4-
using ArrayInterfaceCore
4+
using ArrayInterface
55
using CUDA
66

7-
ArrayInterfaceCore.fast_scalar_indexing(::Type{<:CUDA.CuArray}) = false
8-
@inline ArrayInterfaceCore.allowed_getindex(x::CUDA.CuArray, i...) = CUDA.@allowscalar(x[i...])
9-
@inline ArrayInterfaceCore.allowed_setindex!(x::CUDA.CuArray, v, i...) = (CUDA.@allowscalar(x[i...] = v))
7+
ArrayInterface.fast_scalar_indexing(::Type{<:CUDA.CuArray}) = false
8+
@inline ArrayInterface.allowed_getindex(x::CUDA.CuArray, i...) = CUDA.@allowscalar(x[i...])
9+
@inline ArrayInterface.allowed_setindex!(x::CUDA.CuArray, v, i...) = (CUDA.@allowscalar(x[i...] = v))
1010

1111
function Base.setindex(x::CUDA.CuArray, v, i::Int)
1212
_x = copy(x)
13-
ArrayInterfaceCore.allowed_setindex!(_x, v, i)
13+
ArrayInterface.allowed_setindex!(_x, v, i)
1414
return _x
1515
end
1616

17-
function ArrayInterfaceCore.restructure(x::CUDA.CuArray, y)
18-
reshape(Adapt.adapt(ArrayInterfaceCore.parameterless_type(x), y), Base.size(x)...)
17+
function ArrayInterface.restructure(x::CUDA.CuArray, y)
18+
reshape(Adapt.adapt(ArrayInterface.parameterless_type(x), y), Base.size(x)...)
1919
end
2020

21-
ArrayInterfaceCore.device(::Type{<:CUDA.CuArray}) = ArrayInterfaceCore.GPU()
21+
ArrayInterface.device(::Type{<:CUDA.CuArray}) = ArrayInterface.GPU()
2222

23-
function ArrayInterfaceCore.lu_instance(A::CuMatrix{T}) where {T}
23+
function ArrayInterface.lu_instance(A::CuMatrix{T}) where {T}
2424
CUDA.CUSOLVER.CuQR(similar(A, 0, 0), similar(A, 0))
2525
end
2626

lib/ArrayInterfaceCore/Project.toml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,12 @@
11
name = "ArrayInterfaceCore"
22
uuid = "30b0a656-2188-435a-8636-2ec0e6a096e2"
33
authors = ["Zachary P. Christensen <[email protected]>"]
4-
version = "0.1.0"
4+
version = "0.1.1"
55

66
[deps]
7-
Compat = "34da2185-b29b-5c13-b0c7-acf172513d20"
8-
IfElse = "615f187c-cbe4-4ef1-ba3b-2fcf58d6d173"
97
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
108
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
11-
Static = "aedffcd0-7271-4cad-89d0-dc628f76c6d3"
129
SuiteSparse = "4607b0f0-06f3-5cda-b6b1-a6196a1729e9"
1310

1411
[compat]
15-
Compat = "3.37"
16-
IfElse = "0.1"
17-
Static = "0.6"
1812
julia = "1.6"

0 commit comments

Comments
 (0)