mirror of
https://igit.ific.uv.es/alramos/latticegpu.jl.git
synced 2025-05-15 03:33:42 +02:00
Added tests and support for U(1) group
This commit is contained in:
parent
cd6c28ff5f
commit
0587e5ffea
7 changed files with 332 additions and 1 deletions
41
tests/test_space.jl
Normal file
41
tests/test_space.jl
Normal file
|
@ -0,0 +1,41 @@
|
|||
|
||||
import Pkg
|
||||
#Pkg.activate("/lhome/ific/a/alramos/s.images/julia/workspace/LatticeGPU")
|
||||
Pkg.activate("/home/alberto/code/julia/LatticeGPU")
|
||||
using LatticeGPU, BenchmarkTools
|
||||
|
||||
|
||||
lp = SpaceParm{4}((8,12,6,6), (8,2,2,3))
|
||||
|
||||
function test_point(pt::NTuple{2,Int64}, lp::SpaceParm)
|
||||
ok = true
|
||||
println("Global point: ", global_point(pt, lp))
|
||||
for id in 1:lp.ndim
|
||||
ua, ub = up(pt, id, lp)
|
||||
println(" - UP in id $id: ", global_point((ua,ub), lp))
|
||||
|
||||
da, db = dw(pt, id, lp)
|
||||
println(" - DW in id $id: ", global_point((da,db), lp), "\n")
|
||||
|
||||
ua2, ub2, da2, db2 = updw(pt, id, lp)
|
||||
ok = ok && (ua == ua2)
|
||||
ok = ok && (ub == ub2)
|
||||
ok = ok && (da == da2)
|
||||
ok = ok && (db == db2)
|
||||
end
|
||||
return ok
|
||||
end
|
||||
|
||||
global ok = true
|
||||
for i in 1:lp.bsz, j in 1:lp.rsz
|
||||
global ok = ok && test_point((i,j), lp)
|
||||
end
|
||||
|
||||
if ok
|
||||
println("ALL tests passed")
|
||||
else
|
||||
println("ERROR in test")
|
||||
end
|
||||
|
||||
println(lp)
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue