Skip to content

Commit 30fc3b9

Browse files
Merge pull request #512 from SciML/ChrisRackauckas-patch-5
Faster alias checks for DEDataArray broadcast
2 parents 515b831 + 075db6a commit 30fc3b9

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/data_array.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,3 +162,8 @@ unpack(x::DEDataArray) = x.x
162162
@inline unpack_args(args::Tuple) = (unpack(args[1]), unpack_args(Base.tail(args))...)
163163
unpack_args(args::Tuple{Any}) = (unpack(args[1]),)
164164
unpack_args(::Any, args::Tuple{}) = ()
165+
166+
# Broadcasting checks for aliasing with Base.dataids but the fallback
167+
# for AbstractArrays is very slow. Instead, we just call dataids on the
168+
# wrapped buffer
169+
Base.dataids(A::DEDataArray) = Base.dataids(A.x)

0 commit comments

Comments
 (0)