Skip to content
Snippets Groups Projects
Commit 9f1d0abb authored by Brian Groenke's avatar Brian Groenke
Browse files

Fix breaking change from new PreallocationTools

parent 28fa627b
No related branches found
No related tags found
1 merge request!91Fix regression in interact! behavior
...@@ -71,7 +71,7 @@ Base.show(io::IO, mime::MIME{Symbol("text/plain")}, cache::DiffCache) = show(io, ...@@ -71,7 +71,7 @@ Base.show(io::IO, mime::MIME{Symbol("text/plain")}, cache::DiffCache) = show(io,
function Prealloc.get_tmp(dc::Prealloc.DiffCache, ::Type{T}) where {T<:ForwardDiff.Dual} function Prealloc.get_tmp(dc::Prealloc.DiffCache, ::Type{T}) where {T<:ForwardDiff.Dual}
# this part is copied from PreallocationTools source code # this part is copied from PreallocationTools source code
nelem = div(sizeof(T), sizeof(eltype(dc.dual_du)))*length(dc.du) nelem = div(sizeof(T), sizeof(eltype(dc.dual_du)))*length(dc.du)
Prealloc.ArrayInterface.restructure(dc.du, reinterpret(T, view(dc.dual_du, 1:nelem))) Prealloc.ArrayInterfaceCore.restructure(dc.du, reinterpret(T, view(dc.dual_du, 1:nelem)))
end end
retrieve(dc::DiffCache) = dc.cache.du retrieve(dc::DiffCache) = dc.cache.du
# for matching chunk sizes, retrieve from cache # for matching chunk sizes, retrieve from cache
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment