Skip to content

Commit

Permalink
Update AMDGPU sync
Browse files Browse the repository at this point in the history
  • Loading branch information
luraess committed Oct 10, 2023
1 parent 17b1a3a commit 5cc6c3e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions scripts_future_API/bench3d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ function compute_ka(hide_comm, comm, backend, neighbors, ranges, A_new, A, h, _d
tic = time_ns()
for _ = 1:iters
# copyto!(A, A_new)
# AMDGPU.synchronize(blocking=false) #KernelAbstractions.synchronize(backend)
# KernelAbstractions.synchronize(backend)
hide_comm(diffusion_kernel!(backend, 256), neighbors, ranges, A_new, A, h, _dx, _dy, _dz)
A, A_new = A_new, A

# diffusion_kernel!(backend, 256)(A_new, A, h, _dx, _dy, _dz, (1, 1, 1); ndrange=size(A))
# AMDGPU.synchronize(blocking=false) #KernelAbstractions.synchronize(backend)
# KernelAbstractions.synchronize(backend)
# A, A_new = A_new, A
end
wtime = (time_ns() - tic) * 1e-9
Expand Down Expand Up @@ -73,7 +73,7 @@ function main(backend=CPU(), T::DataType=Float64, dims=(0, 0, 0))
A = KernelAbstractions.allocate(backend, T, nx, ny, nz)
A_new = KernelAbstractions.allocate(backend, T, nx, ny, nz)
KernelAbstractions.copyto!(backend, A, A_ini)
AMDGPU.synchronize(blocking=false) #KernelAbstractions.synchronize(backend)
KernelAbstractions.synchronize(backend)
A_new = copy(A)

### to be hidden later
Expand All @@ -97,12 +97,12 @@ function main(backend=CPU(), T::DataType=Float64, dims=(0, 0, 0))
if compute_bc
# apply_bcs!(Val(dim), fields, bcs.velocity)
end
AMDGPU.synchronize(blocking=false) #KernelAbstractions.synchronize(backend)
KernelAbstractions.synchronize(backend)
end
end
wait.(exchangers[dim])
end
AMDGPU.synchronize(blocking=false) #KernelAbstractions.synchronize(backend)
KernelAbstractions.synchronize(backend)
end
### to be hidden later

Expand Down
4 changes: 2 additions & 2 deletions scripts_future_API/mpi_utils2.jl
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ mutable struct Exchanger
f(compute_bc)
if has_neighbor
copyto!(send_buf, border)
AMDGPU.synchronize(blocking=false) #KernelAbstractions.synchronize(backend)
KernelAbstractions.synchronize(backend)
send = MPI.Isend(send_buf, comm; dest=rank)
flag = false
while true
Expand All @@ -76,7 +76,7 @@ mutable struct Exchanger
yield()
end
end
AMDGPU.synchronize(blocking=false) #KernelAbstractions.synchronize(backend)
KernelAbstractions.synchronize(backend)
notify(bottom)
end
catch err
Expand Down

0 comments on commit 5cc6c3e

Please sign in to comment.