dpar.rep modified in randomize but in the test

parent c19d6883
......@@ -4,30 +4,37 @@ using CUDA,LatticeGPU, TimerOutputs
@timeit "Rand solver test" begin
function pfrandomize!(f,lp::SpaceParm,dpar::DiracParam)
function pfrandomize!(f,lp::SpaceParm,dpar::DiracParam{T,SU3fund},t::Int64=0) where {T}
if dpar.rep == SU3fund && lp.ndim == 4
begin
p = ntuple(i->CUDA.randn(Float64, lp.bsz, 3, lp.rsz,2),4)
@timeit "Randomize pseudofermion field" begin
p = ntuple(i->CUDA.randn(Float64, lp.bsz, 3, lp.rsz,2),4) # complex generation not suported for Julia 1.5.4
CUDA.@sync begin
CUDA.@cuda threads=lp.bsz blocks=lp.rsz krnl_assign_pf!(f,p,lp)
CUDA.@cuda threads=lp.bsz blocks=lp.rsz krnl_assign_pf!(f,p,lp,t)
end
end
end
return nothing
end
function krnl_assign_pf!(f::AbstractArray{T}, p ,lp::SpaceParm) where {T}
function krnl_assign_pf!(f::AbstractArray{T}, p ,lp::SpaceParm, t::Int64) where {T}
@inbounds begin
b = Int64(CUDA.threadIdx().x)
r = Int64(CUDA.blockIdx().x)
if t == 0
f[b,r] = Spinor(map(x->SU3fund(x[b,1,r,1] + im* x[b,1,r,2],
x[b,2,r,1] + im* x[b,2,r,2],
x[b,3,r,1] + im* x[b,3,r,2]),p))
elseif point_time((b,r),lp) == t
f[b,r] = Spinor(map(x->SU3fund(x[b,1,r,1] + im* x[b,1,r,2],
x[b,2,r,1] + im* x[b,2,r,2],
x[b,3,r,1] + im* x[b,3,r,2]),p))
end
end
return nothing
end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment