Skip to content

Commit

Permalink
use PrecompileTools.jl (#337)
Browse files Browse the repository at this point in the history
  • Loading branch information
hyrodium authored Oct 28, 2023
1 parent 8f9f77a commit 6ed8f79
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ version = "0.9.4"
ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4"
IntervalSets = "8197267c-284f-5f27-9208-e0e47529a953"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
PrecompileTools = "aea7be01-6a6a-4083-8856-8a6e6704d82a"
RecipesBase = "3cdcf5f2-1ef4-517c-9805-6587b60abb01"
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
Expand All @@ -23,6 +24,7 @@ BasicBSplineRecipesBaseExt = "RecipesBase"
Aqua = "0.7"
ChainRulesCore = "1.15"
IntervalSets = "0.5, 0.6, 0.7"
PrecompileTools = "1"
RecipesBase = "1"
StaticArrays = "1"
julia = "^1.6"
Expand Down
2 changes: 2 additions & 0 deletions src/BasicBSpline.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ using LinearAlgebra
using SparseArrays
using IntervalSets
using StaticArrays
using PrecompileTools

# Types
export AbstractKnotVector, KnotVector, UniformKnotVector, EmptyKnotVector, SubKnotVector
Expand Down Expand Up @@ -49,6 +50,7 @@ include("_ChangeBasis.jl")
include("_BSplineManifold.jl")
include("_RationalBSplineManifold.jl")
include("_Refinement.jl")
include("_precompile.jl")

if !isdefined(Base, :get_extension)
include("../ext/BasicBSplineChainRulesCoreExt.jl")
Expand Down
14 changes: 14 additions & 0 deletions src/_precompile.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
@setup_workload begin
k1 = KnotVector(1:8)
k2 = UniformKnotVector(1:8)
P1 = BSplineSpace{3}(k1)
P2 = BSplineSpace{3}(k2)
@compile_workload begin
changebasis_I(P1, P1)
changebasis_R(P1, P1)
changebasis_I(P1, P2)
changebasis_R(P1, P2)
changebasis_I(P2, P2)
changebasis_R(P2, P2)
end
end

0 comments on commit 6ed8f79

Please sign in to comment.