Changed functions kV and kT

parent 3d913155
...@@ -64,6 +64,6 @@ include("Solvers/Solvers.jl") ...@@ -64,6 +64,6 @@ include("Solvers/Solvers.jl")
using .Solvers using .Solvers
export CG! export CG!
export propagator, bndpropagator, Tbndpropagator export propagator, bndpropagator, Tbndpropagator
export fP, fA, kV, lV export fP, fA, kV, kT
end # module end # module
...@@ -26,7 +26,7 @@ include("Propagators.jl") ...@@ -26,7 +26,7 @@ include("Propagators.jl")
export propagator, bndpropagator, Tbndpropagator export propagator, bndpropagator, Tbndpropagator
include("sfcf.jl") include("sfcf.jl")
export fP, fA, kV, lV export fP, fA, kV, kT
end end
...@@ -44,7 +44,7 @@ function kV(prop::AbstractArray,dws::DiracWorkspace, lp::SpaceParm) ...@@ -44,7 +44,7 @@ function kV(prop::AbstractArray,dws::DiracWorkspace, lp::SpaceParm)
r=Int64(CUDA.blockIdx().x) r=Int64(CUDA.blockIdx().x)
I = point_coord((b,r), lp) I = point_coord((b,r), lp)
sum[I] = -(norm2(dmul(Gamma{6},pro[b,r])) + norm2(dmul(Gamma{7},pro[b,r])) + norm2(dmul(Gamma{8},pro[b,r])))/6 sum[I] = -norm2(dmul(Gamma{6},pro[b,r]) + dmul(Gamma{7},pro[b,r]) + dmul(Gamma{8},pro[b,r]))/6
return nothing return nothing
end end
...@@ -55,21 +55,19 @@ function kV(prop::AbstractArray,dws::DiracWorkspace, lp::SpaceParm) ...@@ -55,21 +55,19 @@ function kV(prop::AbstractArray,dws::DiracWorkspace, lp::SpaceParm)
return reshape(Array(CUDA.reduce(+, dws.cs; dims=(1,2,3))),lp.iL[end]) return reshape(Array(CUDA.reduce(+, dws.cs; dims=(1,2,3))),lp.iL[end])
end end
function lV(prop::AbstractArray,dws::DiracWorkspace, lp::SpaceParm) function kT(prop::AbstractArray,dws::DiracWorkspace, lp::SpaceParm)
function krnl_lV!(sum,pro) function krnl_kT!(sum,pro)
b=Int64(CUDA.threadIdx().x) b=Int64(CUDA.threadIdx().x)
r=Int64(CUDA.blockIdx().x) r=Int64(CUDA.blockIdx().x)
I = point_coord((b,r), lp) I = point_coord((b,r), lp)
sum[I] = im*(dot(dmul(Gamma{6},pro[b,r]),dmul(Gamma{5},dmul(Gamma{10},pro[b,r]))) sum[I] = -im*dot(pro[b,r],dmul(Gamma{1},dmul(Gamma{10},pro[b,r])) + dmul(Gamma{2},dmul(Gamma{11},pro[b,r])) + dmul(Gamma{3},dmul(Gamma{12},pro[b,r]))) /6
+ dot(dmul(Gamma{7},pro[b,r]),dmul(Gamma{5},dmul(Gamma{11},pro[b,r])))
+ dot(dmul(Gamma{8},pro[b,r]),dmul(Gamma{5},dmul(Gamma{12},pro[b,r]))))/6
return nothing return nothing
end end
CUDA.@sync begin CUDA.@sync begin
CUDA.@cuda threads=lp.bsz blocks=lp.rsz krnl_lV!(dws.cs,prop) CUDA.@cuda threads=lp.bsz blocks=lp.rsz krnl_kT!(dws.cs,prop)
end end
return reshape(Array(CUDA.reduce(+, dws.cs; dims=(1,2,3))),lp.iL[end]) return reshape(Array(CUDA.reduce(+, dws.cs; dims=(1,2,3))),lp.iL[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