Skip to content

Commit c472184

Browse files
committed
Added default for abstract arrays that tries to extract a parent to make it dense. If extracting parent succeeds, but the parent is a non-dense AbstractArray, it will stackoverflow, which unfortunately is not an informative error.
1 parent f4f3da0 commit c472184

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "VectorizationBase"
22
uuid = "3d5dd08c-fd9d-11e8-17fa-ed2836048c2f"
33
authors = ["Chris Elrod <elrodc@gmail.com>"]
4-
version = "0.1.1"
4+
version = "0.1.2"
55

66
[deps]
77
CpuId = "adafc99b-e345-5852-983c-f28acb93d879"

src/vectorizable.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,7 @@ end
361361

362362

363363
@inline stridedpointer(x) = Pointer(x)
364+
@inline stridedpointer(x::AbstractArray) = stridedpointer(parent(x))
364365
@inline stridedpointer(A::DenseArray) = PackedStridedPointer(pointer(A), Base.tail(strides(A)))
365366
@generated function stridedpointer(A::SubArray{T,N,P,S,B}) where {T,N,P,S,B}
366367
if first(S.parameters) <: Integer # nonunit stride 1

0 commit comments

Comments
 (0)