Skip to content

Commit 20cc8e7

Browse files
committed
More fixes for interface tests
1 parent c53e70b commit 20cc8e7

File tree

6 files changed

+32
-10
lines changed

6 files changed

+32
-10
lines changed

Project.toml

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
name = "SparseDiffTools"
22
uuid = "47a9eef4-7e08-11e9-0b38-333d64bd3804"
3-
authors = ["Pankaj Mishra <pankajmishra1511@gmail.com>", "Chris Rackauckas <contact@chrisrackauckas.com>"]
3+
authors = [
4+
"Pankaj Mishra <pankajmishra1511@gmail.com>",
5+
"Chris Rackauckas <contact@chrisrackauckas.com>",
6+
]
47
version = "2.19.0"
58

69
[deps]
@@ -68,6 +71,7 @@ Zygote = "0.6"
6871
julia = "1.10"
6972

7073
[extras]
74+
AllocCheck = "9b6a8646-10ed-4001-bbdc-1d2f46dfbb1a"
7175
BandedMatrices = "aae01518-5342-5314-be14-df237901396f"
7276
BlockBandedMatrices = "ffab5731-97b5-5995-9138-79e8c1846df0"
7377
Enzyme = "7da242da-08ed-463a-9acd-ee780be4f1d9"
@@ -83,4 +87,18 @@ Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
8387
Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f"
8488

8589
[targets]
86-
test = ["Test", "BandedMatrices", "BlockBandedMatrices", "Enzyme", "IterativeSolvers", "Pkg", "Random", "SafeTestsets", "Symbolics", "Zygote", "StaticArrays"]
90+
test = [
91+
"Test",
92+
"AllocCheck",
93+
"BandedMatrices",
94+
"BlockBandedMatrices",
95+
"Enzyme",
96+
"IterativeSolvers",
97+
"Pkg",
98+
"PolyesterForwardDiff",
99+
"Random",
100+
"SafeTestsets",
101+
"Symbolics",
102+
"Zygote",
103+
"StaticArrays",
104+
]

src/SparseDiffTools.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ end
3131

3232
abstract type AbstractAutoDiffVecProd end
3333

34+
my_dense_ad(ad::AbstractADType) = ad
35+
my_dense_ad(ad::AutoSparse) = ADTypes.dense_ad(ad)
36+
3437
include("coloring/high_level.jl")
3538
include("coloring/backtracking_coloring.jl")
3639
include("coloring/contraction_coloring.jl")

src/highlevel/common.jl

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,13 @@ If `fx` is not specified, it will be computed by calling `f(x)`.
171171
A cache for computing the Jacobian of type `AbstractMaybeSparseJacobianCache`.
172172
"""
173173
function sparse_jacobian_cache(
174-
ad::AbstractADType, sd::AbstractSparsityDetection, args...; kwargs...)
175-
return sparse_jacobian_cache_aux(mode(ad), ad, sd, args...; kwargs...)
174+
ad::AbstractADType, sd::AbstractSparsityDetection, f, x; fx = nothing)
175+
return sparse_jacobian_cache_aux(mode(ad), ad, sd, f, x; fx)
176+
end
177+
178+
function sparse_jacobian_cache(
179+
ad::AbstractADType, sd::AbstractSparsityDetection, f!, x, fx)
180+
return sparse_jacobian_cache_aux(mode(ad), ad, sd, f!, x, fx)
176181
end
177182

178183
function sparse_jacobian_static_array(ad, cache, f, x::SArray)

src/highlevel/forward_mode.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ function sparse_jacobian_cache_aux(
1717
sd::AbstractMaybeSparsityDetection, f::F, x; fx = nothing) where {F}
1818
coloring_result = sd(ad, f, x)
1919
fx = fx === nothing ? similar(f(x)) : fx
20-
tag = __standard_tag(ad.tag, f, x)
20+
tag = __standard_tag(my_dense_ad(ad).tag, f, x)
2121
if coloring_result isa NoMatrixColoring
2222
cache = ForwardDiff.JacobianConfig(f, x, __chunksize(ad, x), tag)
2323
jac_prototype = nothing
@@ -34,7 +34,7 @@ function sparse_jacobian_cache_aux(
3434
::ForwardMode, ad::Union{AutoSparse{<:AutoForwardDiff}, AutoForwardDiff},
3535
sd::AbstractMaybeSparsityDetection, f!::F, fx, x) where {F}
3636
coloring_result = sd(ad, f!, fx, x)
37-
tag = __standard_tag(ad.tag, f!, x)
37+
tag = __standard_tag(my_dense_ad(ad).tag, f!, x)
3838
if coloring_result isa NoMatrixColoring
3939
cache = ForwardDiff.JacobianConfig(f!, fx, x, __chunksize(ad, x), tag)
4040
jac_prototype = nothing

test/1.10specific/Project.toml

Lines changed: 0 additions & 3 deletions
This file was deleted.

test/runtests.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ if GROUP == "Core" || GROUP == "All"
4242
end
4343

4444
if GROUP == "InterfaceI" || GROUP == "All"
45-
activate_env("1.10specific")
4645
@time @safetestset "Jac Vecs and Hes Vecs" begin
4746
include("test_jaches_products.jl")
4847
end

0 commit comments

Comments
 (0)