File tree Expand file tree Collapse file tree 2 files changed +15
-3
lines changed Expand file tree Collapse file tree 2 files changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -20,13 +20,21 @@ function that is being called.
2020
2121` DiffCache ` is a type for doubly-preallocated vectors which are
2222compatible with non-allocating forward-mode automatic differentiation by
23- ForwardDiff.jl. Since ForwardDiff uses chunked duals in its forward pass, two
23+ [ ForwardDiff.jl] ( https://github.com/JuliaDiff/ForwardDiff.jl ) .
24+ Since ForwardDiff.jl uses chunked duals in its forward pass, two
2425vector sizes are required in order for the arrays to be properly defined.
2526` DiffCache ` creates a dispatching type to solve this, so that by passing a
2627qualifier it can automatically switch between the required cache. This method
2728is fully type-stable and non-dynamic, made for when the highest performance is
2829needed.
2930
31+ The ` DiffCache ` also supports sparsity detection via
32+ [ SparseConnectivityTracer.jl] ( https://github.com/adrhill/SparseConnectivityTracer.jl/ ) .
33+ However, the implementation may allocate memory in this case since we assume that
34+ sparsity detection happens only once (or maybe a few times). Allocating memory
35+ allows to save memory in the long run since no additional cache needs to be stored
36+ forever.
37+
3038### Using DiffCache
3139
3240``` julia
Original file line number Diff line number Diff line change 107107
108108Builds a `DiffCache` object that stores both a version of the cache for `u`
109109and for the `Dual` version of `u`, allowing use of pre-cached vectors with
110- forward-mode automatic differentiation. Supports nested AD via keyword `levels`
111- or specifying an array of chunk sizes.
110+ forward-mode automatic differentiation via
111+ [ForwardDiff.jl](https://github.com/JuliaDiff/ForwardDiff.jl).
112+ Supports nested AD via keyword `levels` or specifying an array of chunk sizes.
113+
114+ The `DiffCache` also supports sparsity detection via
115+ [SparseConnectivityTracer.jl](https://github.com/adrhill/SparseConnectivityTracer.jl/).
112116"""
113117function DiffCache (u:: AbstractArray , N:: Int = ForwardDiff. pickchunksize (length (u));
114118 levels:: Int = 1 )
You can’t perform that action at this time.
0 commit comments