Skip to content

Commit 8406b13

Browse files
committed
document support of SparseConnectivityTracer.jl
1 parent 1cc0d34 commit 8406b13

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,21 @@ function that is being called.
2020

2121
`DiffCache` is a type for doubly-preallocated vectors which are
2222
compatible 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
2425
vector 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
2627
qualifier it can automatically switch between the required cache. This method
2728
is fully type-stable and non-dynamic, made for when the highest performance is
2829
needed.
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

src/PreallocationTools.jl

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,12 @@ end
107107
108108
Builds a `DiffCache` object that stores both a version of the cache for `u`
109109
and 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
"""
113117
function DiffCache(u::AbstractArray, N::Int = ForwardDiff.pickchunksize(length(u));
114118
levels::Int = 1)

0 commit comments

Comments
 (0)