Bugfix weighted norm FIXME for GPU

newG2L
Cirdans-Home 4 years ago
parent 662481a910
commit 73605bdda0

@ -1028,9 +1028,23 @@ contains
real(psb_spk_) :: res real(psb_spk_) :: res
integer(psb_ipk_) :: info integer(psb_ipk_) :: info
if (allocated(x%v).and.allocated(w%v)) then ! Temp vectors
call w%v%mlt(x%v,info) type(psb_c_vect_type) :: wtemp
res = w%v%nrm2(n)
if( allocated(w%v) ) then
! FIXME for GPU
allocate(wtemp%v, source=w%v, stat = info)
else
info = -1
end if
if (info /= 0 ) then
res = -sone
return
end if
if (allocated(x%v)) then
call wtemp%v%mlt(x%v,info)
res = wtemp%v%nrm2(n)
else else
res = szero res = szero
end if end if
@ -1046,10 +1060,27 @@ contains
real(psb_spk_) :: res real(psb_spk_) :: res
integer(psb_ipk_) :: info integer(psb_ipk_) :: info
if (allocated(x%v).and.allocated(w%v).and.allocated(id%v)) then ! Temp vectors
where( abs(id%v%v) <= szero) x%v%v = szero type(psb_c_vect_type) :: wtemp
call w%v%mlt(x%v,info)
res = w%v%nrm2(n) if( allocated(w%v) ) then
! FIXME for GPU
allocate(wtemp%v, source=w%v, stat = info)
else
info = -1
end if
if (info /= 0 ) then
res = -sone
return
end if
if (allocated(x%v).and.allocated(id%v)) then
call wtemp%sync() ! FIXME for GPU
where( abs(id%v%v) <= szero) wtemp%v%v = szero
call wtemp%set_host() ! FIXME for GPU
call wtemp%v%mlt(x%v,info)
res = wtemp%v%nrm2(n)
else else
res = szero res = szero
end if end if

@ -1035,9 +1035,23 @@ contains
real(psb_dpk_) :: res real(psb_dpk_) :: res
integer(psb_ipk_) :: info integer(psb_ipk_) :: info
if (allocated(x%v).and.allocated(w%v)) then ! Temp vectors
call w%v%mlt(x%v,info) type(psb_d_vect_type) :: wtemp
res = w%v%nrm2(n)
if( allocated(w%v) ) then
! FIXME for GPU
allocate(wtemp%v, source=w%v, stat = info)
else
info = -1
end if
if (info /= 0 ) then
res = -done
return
end if
if (allocated(x%v)) then
call wtemp%v%mlt(x%v,info)
res = wtemp%v%nrm2(n)
else else
res = dzero res = dzero
end if end if
@ -1053,10 +1067,27 @@ contains
real(psb_dpk_) :: res real(psb_dpk_) :: res
integer(psb_ipk_) :: info integer(psb_ipk_) :: info
if (allocated(x%v).and.allocated(w%v).and.allocated(id%v)) then ! Temp vectors
where( abs(id%v%v) <= dzero) x%v%v = dzero type(psb_d_vect_type) :: wtemp
call w%v%mlt(x%v,info)
res = w%v%nrm2(n) if( allocated(w%v) ) then
! FIXME for GPU
allocate(wtemp%v, source=w%v, stat = info)
else
info = -1
end if
if (info /= 0 ) then
res = -done
return
end if
if (allocated(x%v).and.allocated(id%v)) then
call wtemp%sync() ! FIXME for GPU
where( abs(id%v%v) <= dzero) wtemp%v%v = dzero
call wtemp%set_host() ! FIXME for GPU
call wtemp%v%mlt(x%v,info)
res = wtemp%v%nrm2(n)
else else
res = dzero res = dzero
end if end if

@ -1035,9 +1035,23 @@ contains
real(psb_spk_) :: res real(psb_spk_) :: res
integer(psb_ipk_) :: info integer(psb_ipk_) :: info
if (allocated(x%v).and.allocated(w%v)) then ! Temp vectors
call w%v%mlt(x%v,info) type(psb_s_vect_type) :: wtemp
res = w%v%nrm2(n)
if( allocated(w%v) ) then
! FIXME for GPU
allocate(wtemp%v, source=w%v, stat = info)
else
info = -1
end if
if (info /= 0 ) then
res = -sone
return
end if
if (allocated(x%v)) then
call wtemp%v%mlt(x%v,info)
res = wtemp%v%nrm2(n)
else else
res = szero res = szero
end if end if
@ -1053,10 +1067,27 @@ contains
real(psb_spk_) :: res real(psb_spk_) :: res
integer(psb_ipk_) :: info integer(psb_ipk_) :: info
if (allocated(x%v).and.allocated(w%v).and.allocated(id%v)) then ! Temp vectors
where( abs(id%v%v) <= szero) x%v%v = szero type(psb_s_vect_type) :: wtemp
call w%v%mlt(x%v,info)
res = w%v%nrm2(n) if( allocated(w%v) ) then
! FIXME for GPU
allocate(wtemp%v, source=w%v, stat = info)
else
info = -1
end if
if (info /= 0 ) then
res = -sone
return
end if
if (allocated(x%v).and.allocated(id%v)) then
call wtemp%sync() ! FIXME for GPU
where( abs(id%v%v) <= szero) wtemp%v%v = szero
call wtemp%set_host() ! FIXME for GPU
call wtemp%v%mlt(x%v,info)
res = wtemp%v%nrm2(n)
else else
res = szero res = szero
end if end if

@ -1028,9 +1028,23 @@ contains
real(psb_dpk_) :: res real(psb_dpk_) :: res
integer(psb_ipk_) :: info integer(psb_ipk_) :: info
if (allocated(x%v).and.allocated(w%v)) then ! Temp vectors
call w%v%mlt(x%v,info) type(psb_z_vect_type) :: wtemp
res = w%v%nrm2(n)
if( allocated(w%v) ) then
! FIXME for GPU
allocate(wtemp%v, source=w%v, stat = info)
else
info = -1
end if
if (info /= 0 ) then
res = -done
return
end if
if (allocated(x%v)) then
call wtemp%v%mlt(x%v,info)
res = wtemp%v%nrm2(n)
else else
res = dzero res = dzero
end if end if
@ -1046,10 +1060,27 @@ contains
real(psb_dpk_) :: res real(psb_dpk_) :: res
integer(psb_ipk_) :: info integer(psb_ipk_) :: info
if (allocated(x%v).and.allocated(w%v).and.allocated(id%v)) then ! Temp vectors
where( abs(id%v%v) <= dzero) x%v%v = dzero type(psb_z_vect_type) :: wtemp
call w%v%mlt(x%v,info)
res = w%v%nrm2(n) if( allocated(w%v) ) then
! FIXME for GPU
allocate(wtemp%v, source=w%v, stat = info)
else
info = -1
end if
if (info /= 0 ) then
res = -done
return
end if
if (allocated(x%v).and.allocated(id%v)) then
call wtemp%sync() ! FIXME for GPU
where( abs(id%v%v) <= dzero) wtemp%v%v = dzero
call wtemp%set_host() ! FIXME for GPU
call wtemp%v%mlt(x%v,info)
res = wtemp%v%nrm2(n)
else else
res = dzero res = dzero
end if end if

Loading…
Cancel
Save