From 42293c62b6c8b731f64f38c0b9b989dd474cfbc7 Mon Sep 17 00:00:00 2001 From: Salvatore Filippone Date: Tue, 21 May 2024 17:49:48 +0200 Subject: [PATCH] Fix usage of sync() --- base/serial/impl/psb_c_base_mat_impl.F90 | 3 +++ base/serial/impl/psb_d_base_mat_impl.F90 | 3 +++ base/serial/impl/psb_s_base_mat_impl.F90 | 3 +++ base/serial/impl/psb_z_base_mat_impl.F90 | 3 +++ 4 files changed, 12 insertions(+) diff --git a/base/serial/impl/psb_c_base_mat_impl.F90 b/base/serial/impl/psb_c_base_mat_impl.F90 index f4bc43cc..fc170a6a 100644 --- a/base/serial/impl/psb_c_base_mat_impl.F90 +++ b/base/serial/impl/psb_c_base_mat_impl.F90 @@ -2060,6 +2060,8 @@ subroutine psb_c_base_vect_cssv(alpha,a,x,beta,y,info,trans,scale,d) goto 9999 end if + if (x%is_dev()) call x%sync() + if (y%is_dev()) call y%sync() if (present(d)) then call d%sync() if (present(scale)) then @@ -2080,6 +2082,7 @@ subroutine psb_c_base_vect_cssv(alpha,a,x,beta,y,info,trans,scale,d) if (info == psb_success_)& & call a%inner_spsm(alpha,tmpv,beta,y,info,trans) + call y%set_host() if (info == psb_success_) then call tmpv%free(info) if (info == psb_success_) deallocate(tmpv,stat=info) diff --git a/base/serial/impl/psb_d_base_mat_impl.F90 b/base/serial/impl/psb_d_base_mat_impl.F90 index 1a8dc084..01a942d1 100644 --- a/base/serial/impl/psb_d_base_mat_impl.F90 +++ b/base/serial/impl/psb_d_base_mat_impl.F90 @@ -2060,6 +2060,8 @@ subroutine psb_d_base_vect_cssv(alpha,a,x,beta,y,info,trans,scale,d) goto 9999 end if + if (x%is_dev()) call x%sync() + if (y%is_dev()) call y%sync() if (present(d)) then call d%sync() if (present(scale)) then @@ -2080,6 +2082,7 @@ subroutine psb_d_base_vect_cssv(alpha,a,x,beta,y,info,trans,scale,d) if (info == psb_success_)& & call a%inner_spsm(alpha,tmpv,beta,y,info,trans) + call y%set_host() if (info == psb_success_) then call tmpv%free(info) if (info == psb_success_) deallocate(tmpv,stat=info) diff --git a/base/serial/impl/psb_s_base_mat_impl.F90 b/base/serial/impl/psb_s_base_mat_impl.F90 index 0b47d472..205d0358 100644 --- a/base/serial/impl/psb_s_base_mat_impl.F90 +++ b/base/serial/impl/psb_s_base_mat_impl.F90 @@ -2060,6 +2060,8 @@ subroutine psb_s_base_vect_cssv(alpha,a,x,beta,y,info,trans,scale,d) goto 9999 end if + if (x%is_dev()) call x%sync() + if (y%is_dev()) call y%sync() if (present(d)) then call d%sync() if (present(scale)) then @@ -2080,6 +2082,7 @@ subroutine psb_s_base_vect_cssv(alpha,a,x,beta,y,info,trans,scale,d) if (info == psb_success_)& & call a%inner_spsm(alpha,tmpv,beta,y,info,trans) + call y%set_host() if (info == psb_success_) then call tmpv%free(info) if (info == psb_success_) deallocate(tmpv,stat=info) diff --git a/base/serial/impl/psb_z_base_mat_impl.F90 b/base/serial/impl/psb_z_base_mat_impl.F90 index 2d97f698..915993f0 100644 --- a/base/serial/impl/psb_z_base_mat_impl.F90 +++ b/base/serial/impl/psb_z_base_mat_impl.F90 @@ -2060,6 +2060,8 @@ subroutine psb_z_base_vect_cssv(alpha,a,x,beta,y,info,trans,scale,d) goto 9999 end if + if (x%is_dev()) call x%sync() + if (y%is_dev()) call y%sync() if (present(d)) then call d%sync() if (present(scale)) then @@ -2080,6 +2082,7 @@ subroutine psb_z_base_vect_cssv(alpha,a,x,beta,y,info,trans,scale,d) if (info == psb_success_)& & call a%inner_spsm(alpha,tmpv,beta,y,info,trans) + call y%set_host() if (info == psb_success_) then call tmpv%free(info) if (info == psb_success_) deallocate(tmpv,stat=info)