Skip to content

Commit bf905c6

Browse files
committed
added which determination
1 parent 4824ad1 commit bf905c6

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

Project.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ ArrayInterface = "4fba245c-0d91-5ea0-9b3e-6abc04ee57a9"
99
DataStructures = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8"
1010
DiffEqDiffTools = "01453d9d-ee7c-5054-8395-0335cb756afa"
1111
ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210"
12+
InteractiveUtils = "b77e0a4c-d291-57a0-90e8-8db25a27a240"
1213
LightGraphs = "093fc24a-ae57-5d10-9952-331d41423f4d"
1314
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
1415
Requires = "ae029012-a4dd-5104-9daa-d747884805df"

test/test_ad.jl

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ using SparseArrays, Test
44
using LinearAlgebra
55
using BlockBandedMatrices
66
using StaticArrays
7+
using InteractiveUtils: @which
78

89
fcalls = 0
910
function f(dx,x)
@@ -84,6 +85,8 @@ function second_derivative_stencil(N)
8485
A
8586
end
8687

88+
@info "ended definitions"
89+
8790
x = rand(30)
8891
dx = rand(30)
8992

@@ -98,21 +101,30 @@ forwarddiff_color_jacobian!(_J1, f, x, colorvec = repeat(1:3,10))
98101
@test _J1 J
99102
@test fcalls == 1
100103

104+
@info "second passed"
105+
101106
fcalls = 0
102107
_J1 = forwarddiff_color_jacobian(oopf, x, colorvec = repeat(1:3,10), sparsity = _J, jac_prototype = _J)
103108
@test _J1 J
104109
@test fcalls == 1
105110

111+
@info "third passed"
112+
106113
fcalls = 0
107114
_J1 = forwarddiff_color_jacobian(oopf, x, colorvec = repeat(1:3,10), sparsity = _J)
108115
@test _J1 J
109116
@test fcalls == 1
110117

118+
@info "4th passed"
119+
111120
fcalls = 0
121+
@info "which $(@which forwarddiff_color_jacobian(staticf, SVector{30}(x), colorvec = repeat(1:3,10), sparsity = _J, jac_prototype = SMatrix{30,30}(_J)))"
112122
_J1 = forwarddiff_color_jacobian(staticf, SVector{30}(x), colorvec = repeat(1:3,10), sparsity = _J, jac_prototype = SMatrix{30,30}(_J))
113123
@test _J1 J
114124
@test fcalls == 1
115125

126+
@info "5"
127+
116128
_J1 = forwarddiff_color_jacobian(staticf, SVector{30}(x), jac_prototype = SMatrix{30,30}(_J))
117129
@test _J1 J
118130
_J1 = forwarddiff_color_jacobian(oopf, x, jac_prototype = similar(_J))

0 commit comments

Comments
 (0)