Mercurial > repos > public > sbplib_julia
diff benchmarkTest.jl @ 81:7f72e7e14659 patch_based_test
Add benchmarktest and mark all apply functions with @inline and @inbounds
author | Vidar Stiernström <vidar.stiernstrom@it.uu.se> |
---|---|
date | Thu, 24 Jan 2019 14:58:22 +0100 |
parents | |
children | 34fd86e9d0b9 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/benchmarkTest.jl Thu Jan 24 14:58:22 2019 +0100 @@ -0,0 +1,21 @@ +include("sbp.jl") +using BenchmarkTools +using Profile +using ProfileView + +function benchmarkTest(m,n) + g = sbp.Grid.EquidistantGrid((m,n), (0.0, 0.0), (2pi, 3/2*pi)) + op = sbp.readOperator("d2_4th.txt","h_4th.txt") + Laplace = sbp.Laplace(g, 1.0, op) + + init(x,y) = sin(x) + cos(y) + v = sbp.Grid.evalOn(g,init) + + u = zeros(eltype(v),length(v)) + + sbp.apply!(Laplace,u,v) + + @time sbp.apply!(Laplace,u,v) + + #@benchmark sbp.apply!(Laplace,u,v) +end