Skip to content

Commit 6103dda

Browse files
committed
OffsetArrays is forwarding wrapper
1 parent 0e7b4e4 commit 6103dda

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

lib/ArrayInterfaceOffsetArrays/Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "ArrayInterfaceOffsetArrays"
22
uuid = "015c0d05-e682-4f19-8f0a-679ce4c54826"
3-
version = "0.1.2"
3+
version = "0.1.3"
44

55
[deps]
66
ArrayInterface = "4fba245c-0d91-5ea0-9b3e-6abc04ee57a9"

lib/ArrayInterfaceOffsetArrays/src/ArrayInterfaceOffsetArrays.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,5 +44,6 @@ end
4444
d = ArrayInterface.to_dims(A, dim)
4545
OffsetArrays.IdOffsetRange(ArrayInterface.axes(parent(A), d), relative_offsets(A, d))
4646
end
47+
@inline ArrayInterface.is_forwarding_wrapper(::Type{<:OffsetArrays.OffsetArray}) = true
4748

4849
end # module

lib/ArrayInterfaceOffsetArrays/test/runtests.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,6 @@ o = OffsetArray(vec(A), 8);
2929
offset_view = @view OffsetArrays.centered(zeros(eltype(A), 5, 5))[:, begin]; # SubArray of OffsetArray
3030
@test @inferred(ArrayInterface.offsets(offset_view)) == (-2,)
3131

32+
B = OffsetArray(PermutedDimsArray(rand(2,3,4), (2,3,1)));
33+
@test @inferred(ArrayInterface.StrideIndex(B)) === ArrayInterface.StrideIndex{3, (2, 3, 1), 3}((2, 6, static(1)), (1, 1, 1))
34+

0 commit comments

Comments
 (0)