From be469f88444f905f53d15a73e0bd00f9141f629b Mon Sep 17 00:00:00 2001 From: sfilippone Date: Fri, 21 Feb 2025 15:39:43 +0100 Subject: [PATCH] Added comments on allocat_wrk --- samples/cuda/amg_dexample_cuda.F90 | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/samples/cuda/amg_dexample_cuda.F90 b/samples/cuda/amg_dexample_cuda.F90 index 4eb5e218..fd543427 100644 --- a/samples/cuda/amg_dexample_cuda.F90 +++ b/samples/cuda/amg_dexample_cuda.F90 @@ -1267,6 +1267,16 @@ program amg_dexample_cuda ! solve Ax=b with preconditioned Krylov method call psb_barrier(ctxt) + ! + ! Most preconditioners require auxiliary storage. When running + ! on the HOST side, allocation/deallocation are usually very cheap + ! and can be performed for every invocation of prec%apply. + ! However when running on the DEVICE side, such memory management + ! operations are global synchronization points, hence very costly. + ! Thus the two methods below that preallocate the memory space + ! prior to the invocation of the Krylov method, and release memory + ! after the method has completed. + ! call prec%allocate_wrk(info,vmold=vmold) t1 = psb_wtime()