Skip to content

Commit 08c8fd0

Browse files
committed
Reorganization
1 parent 05a2e51 commit 08c8fd0

File tree

2 files changed

+23
-21
lines changed

2 files changed

+23
-21
lines changed

ext/MeshIntegralsEnzymeExt.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ MeshIntegrals.supports_autoenzyme(::Type{<:Meshes.Geometry}) = true
2121
MeshIntegrals.supports_autoenzyme(::Type{<:Meshes.Domain}) = true
2222
# except for those that throw errors (see GitHub Issue #154)
2323
MeshIntegrals.supports_autoenzyme(::Type{<:Meshes.BezierCurve}) = false
24-
MeshIntegrals.supports_autoenzyme(::Type{<:Meshes.CylinderSurface}) = false
2524
MeshIntegrals.supports_autoenzyme(::Type{<:Meshes.Cylinder}) = false
25+
MeshIntegrals.supports_autoenzyme(::Type{<:Meshes.CylinderSurface}) = false
2626
MeshIntegrals.supports_autoenzyme(::Type{<:Meshes.ParametrizedCurve}) = false
2727

2828
end

test/utils.jl

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -26,33 +26,35 @@ end
2626
end
2727

2828
@testitem "Differentiation (EnzymeExt loaded)" setup=[Utils] begin
29-
# supports_autoenzyme(::Type{<:Any})
30-
@test MeshIntegrals.supports_autoenzyme(Nothing) == false
31-
32-
# Check currency of supports_autoenzyme status
33-
curve = BezierCurve([Point(t, 0) for t in range(-π, π, length = 361)])
34-
@test_throws "proven readonly" jacobian(curve, (0.5,), AutoEnzyme())
35-
cyl = Cylinder(Point(0, 0, 0), Point(0, 0, 1), 2.0)
36-
@test_throws "jl_get_builtin_fptr" jacobian(cyl, (0.5, 0.5, 0.5), AutoEnzyme())
37-
cylsurf = CylinderSurface(Point(0, 0, 0), Point(0, 0, 1), 2.0)
38-
@test_throws "jl_get_builtin_fptr" jacobian(cylsurf, (0.5, 0.5), AutoEnzyme())
39-
40-
# _default_diff_method -- using type or instance, Enzyme-supported combination
29+
# supports_autoenzyme & _default_diff_method
30+
# Nominal usage: Enzyme-supported geometry and FP type
4131
let sphere = Sphere(Point(0, 0, 0), 1.0)
4232
@test _default_diff_method(Meshes.Sphere, Float64) isa AutoEnzyme
4333
@test _default_diff_method(sphere, Float64) isa AutoEnzyme
4434
end
45-
46-
# _default_diff_method -- Enzyme-unsupported FP types
35+
# supports_autoenzyme(::Type{<:Any}) for CI completeness
36+
@test MeshIntegrals.supports_autoenzyme(Nothing) == false
37+
# BezierCurve: blocked by upstream Meshes-Enzyme incompatibility
38+
let curve = BezierCurve([Point(t, 0) for t in range(-π, π, length = 361)])
39+
@test_throws "proven readonly" jacobian(curve, (0.5,), AutoEnzyme())
40+
@test _default_diff_method(Meshes.BezierCurve, Float64) isa FiniteDifference
41+
end
42+
# Cylinder: blocked by upstream Meshes-Enzyme incompatibility
43+
let cyl = Cylinder(Point(0, 0, 0), Point(0, 0, 1), 2.0)
44+
@test_throws "jl_get_builtin_fptr" jacobian(cyl, (0.5, 0.5, 0.5), AutoEnzyme())
45+
@test _default_diff_method(Meshes.Cylinder, Float64) isa FiniteDifference
46+
end
47+
# CylinderSurface: blocked by upstream Meshes-Enzyme incompatibility
48+
let cylsurf = CylinderSurface(Point(0, 0, 0), Point(0, 0, 1), 2.0)
49+
@test_throws "jl_get_builtin_fptr" jacobian(cylsurf, (0.5, 0.5), AutoEnzyme())
50+
@test _default_diff_method(Meshes.CylinderSurface, Float64) isa FiniteDifference
51+
end
52+
# ParametrizedCurve: no default AD since user-defined functions
53+
@test _default_diff_method(Meshes.ParametrizedCurve, Float64) isa FiniteDifference
54+
# Non-Float64: other FP types not supported by Enzyme
4755
@test _default_diff_method(Meshes.Sphere, Float16) isa FiniteDifference
4856
@test _default_diff_method(Meshes.Sphere, BigFloat) isa FiniteDifference
4957

50-
# _default_diff_method -- geometries that currently error with AutoEnzyme
51-
@test _default_diff_method(Meshes.BezierCurve, Float64) isa FiniteDifference
52-
@test _default_diff_method(Meshes.CylinderSurface, Float64) isa FiniteDifference
53-
@test _default_diff_method(Meshes.Cylinder, Float64) isa FiniteDifference
54-
@test _default_diff_method(Meshes.ParametrizedCurve, Float64) isa FiniteDifference
55-
5658
# FiniteDifference
5759
@test FiniteDifference().ε 1e-6
5860

0 commit comments

Comments
 (0)