Some cleanup

This commit is contained in:
Alberto Ramos 2021-09-25 09:35:56 +02:00
parent bee24c52a8
commit e18183d517
5 changed files with 61 additions and 66 deletions

View file

@ -9,29 +9,31 @@
### created: Mon Jul 12 18:31:19 2021
###
function krnl_plaq!(plx, U, ipl, lp::SpaceParm)
id1, id2 = lp.plidx[ipl]
b, r = CUDA.threadIdx().x, CUDA.blockIdx().x
bu1, ru1 = up((b, r), id1, lp)
bu2, ru2 = up((b, r), id2, lp)
@inbounds plx[b, r] = tr(U[b,id1,r]*U[bu1,id2,ru1] / (U[b,id2,r]*U[bu2,id1,ru2]))
return nothing
end
function krnl_plaq!(plx, U, lp::SpaceParm)
function krnl_plaq!(plx, U, lp::SpaceParm{N,M,D}) where {T,N,M,D}
b, r = CUDA.threadIdx().x, CUDA.blockIdx().x
Ush = @cuStaticSharedMem(T, (D,2))
plx[b,r] = zero(plx[b,r])
@inbounds for ipl in 1:lp.npls
id1, id2 = lp.plidx[ipl]
bu1, ru1 = up((b, r), id1, lp)
bu2, ru2 = up((b, r), id2, lp)
plx[b,r] += tr(U[b,id1,r]*U[bu1,id2,ru1] / (U[b,id2,r]*U[bu2,id1,ru2]))
for id1 in 1:N-1
if ru2 == r
gt2 = Ush[bu2,1]
else
gt2 = U[bu2,id1,ru2]
end
for id2 = id1+1:N
if ru1 == r
gt1 = Ush[bu1,2]
else
gt1 = U[bu1,id2,ru1]
end
sync_threads()
bu1, ru1 = up((b, r), id1, lp)
bu2, ru2 = up((b, r), id2, lp)
plx[b,r] += tr(Ush[b,1]*gt1 / (Ush[b,2]*gt2))
end
return nothing
@ -139,6 +141,12 @@ function krnl_add_force_plns!(frc::AbstractArray{T}, fpl, lp::SpaceParm{N,M,D})
return nothing
end
"""
function force_wilson(ymws::YMworkspace, U, lp::SpaceParm)
Computes the force deriving from the Wilson plaquette action, without
the prefactor 1/g0^2, and assign it to the workspace force `ymws.frc1`
"""
function force_wilson(ymws::YMworkspace, U, lp::SpaceParm)
if ymws.fpln == nothing