|
1 | 1 | module PreallocationTools |
2 | 2 |
|
3 | | -using ForwardDiff, ArrayInterfaceCore, Adapt |
| 3 | +using ForwardDiff, ArrayInterface, Adapt |
4 | 4 |
|
5 | 5 | struct FixedSizeDiffCache{T <: AbstractArray, S <: AbstractArray} |
6 | 6 | du::T |
|
10 | 10 |
|
11 | 11 | function FixedSizeDiffCache(u::AbstractArray{T}, siz, |
12 | 12 | ::Type{Val{chunk_size}}) where {T, chunk_size} |
13 | | - x = ArrayInterfaceCore.restructure(u, |
| 13 | + x = ArrayInterface.restructure(u, |
14 | 14 | zeros(ForwardDiff.Dual{nothing, T, chunk_size}, |
15 | 15 | siz...)) |
16 | 16 | xany = Any[] |
@@ -76,7 +76,7 @@ struct DiffCache{T <: AbstractArray, S <: AbstractArray} |
76 | 76 | end |
77 | 77 |
|
78 | 78 | function DiffCache(u::AbstractArray{T}, siz, chunk_sizes) where {T} |
79 | | - x = adapt(ArrayInterfaceCore.parameterless_type(u), |
| 79 | + x = adapt(ArrayInterface.parameterless_type(u), |
80 | 80 | zeros(T, prod(chunk_sizes .+ 1) * prod(siz))) |
81 | 81 | xany = Any[] |
82 | 82 | DiffCache(u, x, xany) |
@@ -147,7 +147,7 @@ function _restructure(normal_cache::Array, duals) |
147 | 147 | end |
148 | 148 |
|
149 | 149 | function _restructure(normal_cache::AbstractArray, duals) |
150 | | - ArrayInterfaceCore.restructure(normal_cache, duals) |
| 150 | + ArrayInterface.restructure(normal_cache, duals) |
151 | 151 | end |
152 | 152 |
|
153 | 153 | function enlargediffcache!(dc, nelem) #warning comes only once per DiffCache. |
|
0 commit comments