Skip to content

Commit d659c8c

Browse files
Faster alias checks for DEDataArray broadcast
1 parent b1c553c commit d659c8c

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)