Skip to content

Commit 8683b2c

Browse files
Merge pull request #388 from ChrisRackauckas-Claude/static-improvements-20251229-211729
Add JET.jl static analysis tests
2 parents 7649e4c + 57989f8 commit 8683b2c

File tree

3 files changed

+49
-0
lines changed

3 files changed

+49
-0
lines changed

test/Project.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ DiffEqDevTools = "f3b72e0c-5b89-59e1-b016-84e28bfd966d"
66
Distributed = "8ba89e20-285c-5b6f-9357-94700520ee1b"
77
ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210"
88
GPUArraysCore = "46192b85-c4d5-4398-a991-12ede77f4527"
9+
JET = "c3a54625-cd67-489e-a8e7-0a5a0ff4e31b"
910
JLArrays = "27aeb0d3-9eb9-45fb-866b-73c2ecf80fcb"
1011
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
1112
OpenCL = "08131aa3-fb12-5dee-8b74-c09406e224a2"

test/jet_tests.jl

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
using Test
2+
using JET
3+
using DiffEqGPU
4+
using StaticArrays
5+
6+
@testset "JET static analysis" begin
7+
# Test that algorithm constructors are type-stable
8+
@testset "Algorithm constructors" begin
9+
# Explicit algorithms
10+
@test_opt GPUTsit5()
11+
@test_opt GPUVern7()
12+
@test_opt GPUVern9()
13+
14+
# SDE algorithms
15+
@test_opt GPUEM()
16+
@test_opt GPUSIEA()
17+
18+
# Implicit algorithms (with default AD)
19+
@test_opt GPURosenbrock23()
20+
@test_opt GPURodas4()
21+
@test_opt GPURodas5P()
22+
@test_opt GPUKvaerno3()
23+
@test_opt GPUKvaerno5()
24+
end
25+
26+
@testset "Ensemble algorithm constructors" begin
27+
@test_opt EnsembleCPUArray()
28+
end
29+
30+
@testset "alg_order type stability" begin
31+
@test_opt DiffEqGPU.alg_order(GPUTsit5())
32+
@test_opt DiffEqGPU.alg_order(GPUVern7())
33+
@test_opt DiffEqGPU.alg_order(GPUVern9())
34+
@test_opt DiffEqGPU.alg_order(GPUEM())
35+
@test_opt DiffEqGPU.alg_order(GPUSIEA())
36+
end
37+
38+
@testset "Utility functions type stability" begin
39+
# Test diffeqgpunorm with different input types
40+
@test_opt DiffEqGPU.diffeqgpunorm([1.0f0, 2.0f0, 3.0f0], 0.0f0)
41+
@test_opt DiffEqGPU.diffeqgpunorm(1.0f0, 0.0f0)
42+
@test_opt DiffEqGPU.diffeqgpunorm(SA[1.0f0, 2.0f0, 3.0f0], 0.0f0)
43+
end
44+
end

test/runtests.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ const GROUP = get(ENV, "GROUP", "CUDA")
1919

2020
using SafeTestsets, Test
2121

22+
@time @safetestset "JET static analysis" begin
23+
include("jet_tests.jl")
24+
end
25+
2226
@time @safetestset "GPU Kernelized Stiff ODE Mass Matrix" begin
2327
include("gpu_kernel_de/stiff_ode/gpu_ode_mass_matrix.jl")
2428
end

0 commit comments

Comments
 (0)