Skip to content

Commit

Permalink
Add Precompilation
Browse files Browse the repository at this point in the history
  • Loading branch information
roflmaostc committed Dec 11, 2023
1 parent 68b06f9 commit 275d1d5
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ Atomix = "a9b6321e-bd34-4604-b9c9-b65b8de01458"
FFTW = "7a1cc6ca-52ef-59f5-83cd-3a7055c09341"
IndexFunArrays = "613c443e-d742-454e-bfc6-1d7f8dd76566"
KernelAbstractions = "63c18a36-062a-441e-b654-da1e3ab1ce7c"
PrecompileTools = "aea7be01-6a6a-4083-8856-8a6e6704d82a"

[compat]
Atomix = "0.1"
FFTW = "1.7"
julia = "1.9"
KernelAbstractions = "0.9"
IndexFunArrays = "0.2"


KernelAbstractions = "0.9"
PrecompileTools = "1.2"
julia = "1.9"

[extras]
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
Expand Down
23 changes: 23 additions & 0 deletions src/RadonKA.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,32 @@ using KernelAbstractions
using IndexFunArrays
using FFTW
using Atomix
using PrecompileTools

include("utils.jl")
include("radon.jl")
include("iradon.jl")




@setup_workload begin
img = randn((2,2))
angles = range(0, π, 2)

@compile_workload begin
r = radon(Float32.(img), Float32.(angles))
iradon(r, Float32.(angles))
RadonKA.filtered_backprojection(r, angles)
r = radon(img, angles)
iradon(r, angles)
RadonKA.filtered_backprojection(r, angles)

r = radon(Float32.(img), Float32.(angles), 0.1f0)
iradon(r, Float32.(angles), 0.1f0)
r = radon(img, angles, 0.1)
iradon(r, angles, 0.1)
end
end

end

0 comments on commit 275d1d5

Please sign in to comment.