@@ -21,7 +21,7 @@ x = randn(Float32, 100);
2121
2222J_true = ForwardDiff. jacobian (fdiff, x);
2323
24- @info " `ForwardDiff.jacobian` time: $(@belapsed (ForwardDiff. jacobian ($ fdiff, $ x))) s"
24+ @info " `ForwardDiff.jacobian` time: $(@elapsed (ForwardDiff. jacobian (diff, x))) s"
2525
2626# SparseDiffTools High-Level API
2727J_sparsity = Symbolics. jacobian_sparsity (fdiff, similar (x), x);
@@ -44,15 +44,15 @@ SPARSITY_DETECTION_ALGS = [JacPrototypeSparsityDetection(jac_prototype = J_spars
4444 @test J ≈ J_true
4545 @inferred sparse_jacobian! (J, difftype, cache, fdiff, x)
4646
47- t₁ = @belapsed sparse_jacobian! ($ J, $ difftype, $ cache, $ fdiff, $ x)
47+ t₁ = @elapsed sparse_jacobian! (J, difftype, cache, fdiff, x)
4848 @info " $(nameof (typeof (difftype))) () `sparse_jacobian!` (only differentiation) time: $(t₁) s"
4949
5050 J = sparse_jacobian (difftype, cache, fdiff, x)
5151
5252 @test J ≈ J_true
5353 # @inferred sparse_jacobian(difftype, cache, fdiff, x)
5454
55- t₂ = @belapsed sparse_jacobian ($ difftype, $ cache, $ fdiff, $ x)
55+ t₂ = @elapsed sparse_jacobian (difftype, cache, fdiff, x)
5656 @info " $(nameof (typeof (difftype))) () `sparse_jacobian` (with matrix allocation) time: $(t₂) s"
5757 end
5858
@@ -62,7 +62,7 @@ SPARSITY_DETECTION_ALGS = [JacPrototypeSparsityDetection(jac_prototype = J_spars
6262 @test J ≈ J_true
6363 # @inferred sparse_jacobian(difftype, sd, fdiff, x)
6464
65- t₁ = @belapsed sparse_jacobian ($ difftype, $ sd, $ fdiff, $ x)
65+ t₁ = @elapsed sparse_jacobian (difftype, sd, fdiff, x)
6666 @info " $(nameof (typeof (difftype))) () `sparse_jacobian` (complete) time: $(t₁) s"
6767
6868 cache = sparse_jacobian_cache (difftype, sd, fdiff, x)
@@ -73,7 +73,7 @@ SPARSITY_DETECTION_ALGS = [JacPrototypeSparsityDetection(jac_prototype = J_spars
7373 @test J ≈ J_true
7474 @inferred sparse_jacobian! (J, difftype, sd, fdiff, x)
7575
76- t₂ = @belapsed sparse_jacobian! ($ J, $ difftype, $ sd, $ fdiff, $ x)
76+ t₂ = @elapsed sparse_jacobian! (J, difftype, sd, fdiff, x)
7777 @info " $(nameof (typeof (difftype))) () `sparse_jacobian!` (with matrix coloring) time: $(t₂) s"
7878 end
7979 end
@@ -92,15 +92,15 @@ SPARSITY_DETECTION_ALGS = [JacPrototypeSparsityDetection(jac_prototype = J_spars
9292 @test J ≈ J_true
9393 @inferred sparse_jacobian! (J, difftype, cache, fdiff, y, x)
9494
95- t₁ = @belapsed sparse_jacobian! ($ J, $ difftype, $ cache, $ fdiff, $ y, $ x)
95+ t₁ = @elapsed sparse_jacobian! (J, difftype, cache, fdiff, y, x)
9696 @info " $(nameof (typeof (difftype))) () `sparse_jacobian!` (only differentiation) time: $(t₁) s"
9797
9898 J = sparse_jacobian (difftype, cache, fdiff, y, x)
9999
100100 @test J ≈ J_true
101101 # @inferred sparse_jacobian(difftype, cache, fdiff, y, x)
102102
103- t₂ = @belapsed sparse_jacobian ($ difftype, $ cache, $ fdiff, $ y, $ x)
103+ t₂ = @elapsed sparse_jacobian (difftype, cache, fdiff, y, x)
104104 @info " $(nameof (typeof (difftype))) () `sparse_jacobian` (with jacobian allocation) time: $(t₂) s"
105105 end
106106
@@ -110,7 +110,7 @@ SPARSITY_DETECTION_ALGS = [JacPrototypeSparsityDetection(jac_prototype = J_spars
110110 @test J ≈ J_true
111111 # @inferred sparse_jacobian(difftype, sd, fdiff, y, x)
112112
113- t₁ = @belapsed sparse_jacobian ($ difftype, $ sd, $ fdiff, $ y, $ x)
113+ t₁ = @elapsed sparse_jacobian (difftype, sd, fdiff, y, x)
114114 @info " $(nameof (typeof (difftype))) () `sparse_jacobian` (complete) time: $(t₁) s"
115115
116116 J = SparseDiffTools. __init_𝒥 (cache)
@@ -120,7 +120,7 @@ SPARSITY_DETECTION_ALGS = [JacPrototypeSparsityDetection(jac_prototype = J_spars
120120 @test J ≈ J_true
121121 @inferred sparse_jacobian! (J, difftype, sd, fdiff, y, x)
122122
123- t₂ = @belapsed sparse_jacobian! ($ J, $ difftype, $ sd, $ fdiff, $ y, $ x)
123+ t₂ = @elapsed sparse_jacobian! (J, difftype, sd, fdiff, y, x)
124124 @info " $(nameof (typeof (difftype))) () `sparse_jacobian!` (with matrix coloring) time: $(t₂) s"
125125 end
126126 end
0 commit comments