From 60c1f60d402c8767026c2899acb72b8969bf120c Mon Sep 17 00:00:00 2001 From: Damian Rouson Date: Tue, 5 Dec 2023 07:34:57 -0800 Subject: [PATCH] feat(example): add nested do-loop inferences --- example/concurrent-inferences.f90 | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/example/concurrent-inferences.f90 b/example/concurrent-inferences.f90 index 42bf1213e..70d2f7188 100644 --- a/example/concurrent-inferences.f90 +++ b/example/concurrent-inferences.f90 @@ -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)