Skip to content

Commit

Permalink
Gather on CPU
Browse files Browse the repository at this point in the history
  • Loading branch information
utkinis committed Nov 14, 2023
1 parent 3dea798 commit 6a9eb27
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions scripts_future_API/benchmark_diffusion_3D.jl
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,11 @@ function diffusion_3D(ka_backend=CPU(), dTyp::DataType=Float64, dims=(0,0,0); do

if do_visu
ENV["GKSwstype"]="nul"
C_g = (me == 0) ? KernelAbstractions.allocate(Architectures.backend(arch), eltype(C), size_g) : nothing
gather!(arch, C_g, C)
C_g = (me == 0) ? KernelAbstractions.allocate(CPU(), eltype(C), size_g) : nothing
C_v = Array(C)
gather!(arch, C_g, C_v)
if me == 0
p1 = heatmap(xcenters(global_grid), ycenters(global_grid), Array(C_g)[:, :, size_g[3]÷2];
p1 = heatmap(xcenters(global_grid), ycenters(global_grid), C_g[:, :, size_g[3]÷2];
aspect_ratio=1, xlims=extrema(xcenters(global_grid)), ylims=extrema(ycenters(global_grid)))
png(p1, "C.png")
end
Expand Down

0 comments on commit 6a9eb27

Please sign in to comment.