mirror of
https://igit.ific.uv.es/alramos/latticegpu.jl.git
synced 2025-05-15 03:33:42 +02:00
Added missing files to working tree
This commit is contained in:
parent
3590857f13
commit
42e539c9bd
2 changed files with 122 additions and 0 deletions
31
src/Scalar/ScalarFields.jl
Normal file
31
src/Scalar/ScalarFields.jl
Normal file
|
@ -0,0 +1,31 @@
|
|||
###
|
||||
### "THE BEER-WARE LICENSE":
|
||||
### Alberto Ramos wrote this file. As long as you retain this
|
||||
### notice you can do whatever you want with this stuff. If we meet some
|
||||
### day, and you think this stuff is worth it, you can buy me a beer in
|
||||
### return. <alberto.ramos@cern.ch>
|
||||
###
|
||||
### file: ScalarFields.jl
|
||||
### created: Mon Oct 11 21:18:26 2021
|
||||
###
|
||||
|
||||
function randomize!(f, sp::ScalarParm{NS}, lp::SpaceParm, ymws::YMworkspace) where {NS}
|
||||
|
||||
m = CUDA.randn(ymws.PRC, lp.bsz, 4, NS, lp.rsz)
|
||||
CUDA.@sync begin
|
||||
CUDA.@cuda threads=lp.bsz blocks=lp.rsz krnl_assign_SU2fund!(f,m,sp,lp)
|
||||
end
|
||||
|
||||
return nothing
|
||||
end
|
||||
|
||||
function krnl_assign_SU2fund!(f::AbstractArray{T}, m, sp::ScalarParm{NS}, lp::SpaceParm) where {T, NS}
|
||||
|
||||
b, r = CUDA.threadIdx().x, CUDA.blockIdx().x
|
||||
for i in 1:NS
|
||||
f[b,i,r] = SU2fund(complex(m[b,1,i,r], m[b,2,i,r]),
|
||||
complex(m[b,3,i,r], m[b,4,i,r]))
|
||||
end
|
||||
|
||||
return nothing
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue