Skip to content

Commit

Permalink
Merge pull request #12 from ReactiveBayes/dev-jet
Browse files Browse the repository at this point in the history
Add JET analysis
  • Loading branch information
bvdmitri authored Jun 12, 2024
2 parents 78c94e2 + bec3148 commit b4815f9
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
3 changes: 2 additions & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,11 @@ StaticArraysCore = "1"
julia = "1.6"

[extras]
JET = "c3a54625-cd67-489e-a8e7-0a5a0ff4e31b"
ReTestItems = "817f1d60-ba6b-4fd5-9520-3cf149f6a823"
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
StaticArraysCore = "1e83bf80-4336-4d27-bf5d-d5a4f845583c"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["Test", "StaticArrays", "StaticArraysCore", "ReTestItems"]
test = ["Test", "StaticArrays", "StaticArraysCore", "ReTestItems", "JET"]
6 changes: 3 additions & 3 deletions ext/StaticArraysCoreExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ function FastCholesky.fastcholesky(input::StaticArraysCore.StaticArray)
u = C.uplo
c = C.info
if !LinearAlgebra.issuccess(C)
C_ = cholesky(Positive, C, tol = PositiveFactorizations.default_δ(C))
C_ = cholesky(Positive, Matrix(C), tol = PositiveFactorizations.default_δ(C))
f = typeof(C.factors)(C_.factors)
u = C_.uplo
c = C_.info
u = typeof(C.uplo)(C_.uplo)
c = typeof(C.info)(C_.info)
end
return Cholesky(f, u, c)
end
Expand Down
2 changes: 1 addition & 1 deletion test/fastcholesky_setuptests.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Test, FastCholesky, LinearAlgebra, StaticArrays, StaticArraysCore
using Test, FastCholesky, LinearAlgebra, StaticArrays, StaticArraysCore, JET

const SupportedTypes = (Float32, Float64, BigFloat)

Expand Down
6 changes: 6 additions & 0 deletions test/fastcholesky_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@

# Check that we do not lose the static type in the process for example
@test typeof(cholesky(input)) === typeof(fastcholesky(input))

@test_opt unoptimize_throw_blocks=false ignored_modules=(Base,) fastcholesky(input)
@test_opt unoptimize_throw_blocks=false ignored_modules=(Base,) cholinv(input)
@test_opt unoptimize_throw_blocks=false ignored_modules=(Base,) cholsqrt(input)
@test_opt unoptimize_throw_blocks=false ignored_modules=(Base,) chollogdet(input)
@test_opt unoptimize_throw_blocks=false ignored_modules=(Base,) cholinv_logdet(input)
end
end
end
Expand Down

0 comments on commit b4815f9

Please sign in to comment.