Skip to content
This repository was archived by the owner on Dec 30, 2025. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/kernels.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ abstract type AbstractKernel end
"""SquaredExponentialKernel

"""
struct SquaredExponentialKernel{T} <: AbstractKernel
struct SquaredExponentialKernel{T <: Real} <: AbstractKernel
σ::T
end

Expand All @@ -27,7 +27,7 @@ end
"""Matern52Kernel

"""
struct Matern52Kernel{T} <: AbstractKernel
struct Matern52Kernel{T <: Real} <: AbstractKernel
σ::T
ρ::T
end
4 changes: 4 additions & 0 deletions src/problems.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,7 @@ end

struct IVPSolver <: AbstractFastSolver
end

# Type aliases for convenience
const BVP = BVPSolver
const IVP = IVPSolver
1 change: 1 addition & 0 deletions test/Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[deps]
ExplicitImports = "7d51a73a-1435-4ff3-83d9-f097790105c7"
ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210"
JET = "c3a54625-cd67-489e-a8e7-0a5a0ff4e31b"
NonlinearSolve = "8913a72c-1f9b-4ce2-8d82-65094dcecaec"
QuasiMonteCarlo = "8a4e6c94-4038-4cdc-81c3-7e6ffdb2a71b"
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
Expand Down
30 changes: 30 additions & 0 deletions test/jet.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
using JET

@testset "JET static analysis" begin
@testset "SquaredExponentialKernel type stability" begin
k = SquaredExponentialKernel(1.0)

# Scalar inputs
@test_opt target_modules = (FastSolvers,) k(1.0, 2.0)
@test_opt target_modules = (FastSolvers,) k(1.0, 2.0, ∇())
@test_opt target_modules = (FastSolvers,) k(1.0, 2.0, Δ())

# Vector inputs
X = [1.0, 2.0, 3.0]
Y = [4.0, 5.0, 6.0]
@test_opt target_modules = (FastSolvers,) k(X, Y)
@test_opt target_modules = (FastSolvers,) k(X, Y, ∇())
@test_opt target_modules = (FastSolvers,) k(X, Y, Δ())
end

@testset "No errors in FastSolvers module" begin
# Use @test_call which is more focused on actual errors vs false positives
k = SquaredExponentialKernel(1.0)
X = [1.0, 2.0]
Y = [3.0, 4.0]

@test_call target_modules = (FastSolvers,) k(X, Y)
@test_call target_modules = (FastSolvers,) k(X, Y, ∇())
@test_call target_modules = (FastSolvers,) k(X, Y, Δ())
end
end
4 changes: 4 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,7 @@ end
@testset "Explicit Imports" begin
include("explicit_imports.jl")
end

@testset "JET static analysis" begin
include("jet.jl")
end
Loading