Mercurial > repos > public > sbplib_julia
comparison 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 |
comparison
equal
deleted
inserted
replaced
80:700a74c41b26 | 81:7f72e7e14659 |
---|---|
1 include("sbp.jl") | |
2 using BenchmarkTools | |
3 using Profile | |
4 using ProfileView | |
5 | |
6 function benchmarkTest(m,n) | |
7 g = sbp.Grid.EquidistantGrid((m,n), (0.0, 0.0), (2pi, 3/2*pi)) | |
8 op = sbp.readOperator("d2_4th.txt","h_4th.txt") | |
9 Laplace = sbp.Laplace(g, 1.0, op) | |
10 | |
11 init(x,y) = sin(x) + cos(y) | |
12 v = sbp.Grid.evalOn(g,init) | |
13 | |
14 u = zeros(eltype(v),length(v)) | |
15 | |
16 sbp.apply!(Laplace,u,v) | |
17 | |
18 @time sbp.apply!(Laplace,u,v) | |
19 | |
20 #@benchmark sbp.apply!(Laplace,u,v) | |
21 end |