Skip to content

Commit

Permalink
feat(example): add nested do-loop inferences
Browse files Browse the repository at this point in the history
  • Loading branch information
rouson committed Dec 5, 2023
1 parent aa3064e commit 60c1f60
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions example/concurrent-inferences.f90
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,18 @@ program concurrent_inference

call assert(all(shape(outputs) == shape(inputs)), "all(shape(outputs) == shape(inputs))")

print *,"Performing loop-based inference"
call system_clock(t_start)
do k=1,lev
do j=1,lon
do i=1,lat
outputs(i,j,k) = inference_engine%infer(inputs(i,j,k))
end do
end do
end do
call system_clock(t_finish)
print *,"Looping inference time: ", real(t_finish - t_start, real64)/real(clock_rate, real64)

print *,"Performing concurrent inference"
call system_clock(t_start)
do concurrent(i=1:lat, j=1:lon, k=1:lev)
Expand Down

0 comments on commit 60c1f60

Please sign in to comment.