mirror of
https://github.com/sfilippone/psblas3.git
synced 2026-10-20 12:52:14 +00:00
Merge branch 'development' of github.com:sfilippone/psblas3 into development
This commit is contained in:
@@ -1028,9 +1028,23 @@ contains
|
||||
real(psb_spk_) :: res
|
||||
integer(psb_ipk_) :: info
|
||||
|
||||
if (allocated(x%v).and.allocated(w%v)) then
|
||||
call w%v%mlt(x%v,info)
|
||||
res = w%v%nrm2(n)
|
||||
! Temp vectors
|
||||
type(psb_c_vect_type) :: wtemp
|
||||
|
||||
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
|
||||
res = szero
|
||||
end if
|
||||
@@ -1046,10 +1060,27 @@ contains
|
||||
real(psb_spk_) :: res
|
||||
integer(psb_ipk_) :: info
|
||||
|
||||
if (allocated(x%v).and.allocated(w%v).and.allocated(id%v)) then
|
||||
where( abs(id%v%v) <= szero) x%v%v = szero
|
||||
call w%v%mlt(x%v,info)
|
||||
res = w%v%nrm2(n)
|
||||
! Temp vectors
|
||||
type(psb_c_vect_type) :: wtemp
|
||||
|
||||
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
|
||||
res = szero
|
||||
end if
|
||||
|
||||
@@ -1035,9 +1035,23 @@ contains
|
||||
real(psb_dpk_) :: res
|
||||
integer(psb_ipk_) :: info
|
||||
|
||||
if (allocated(x%v).and.allocated(w%v)) then
|
||||
call w%v%mlt(x%v,info)
|
||||
res = w%v%nrm2(n)
|
||||
! Temp vectors
|
||||
type(psb_d_vect_type) :: wtemp
|
||||
|
||||
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
|
||||
res = dzero
|
||||
end if
|
||||
@@ -1053,10 +1067,27 @@ contains
|
||||
real(psb_dpk_) :: res
|
||||
integer(psb_ipk_) :: info
|
||||
|
||||
if (allocated(x%v).and.allocated(w%v).and.allocated(id%v)) then
|
||||
where( abs(id%v%v) <= dzero) x%v%v = dzero
|
||||
call w%v%mlt(x%v,info)
|
||||
res = w%v%nrm2(n)
|
||||
! Temp vectors
|
||||
type(psb_d_vect_type) :: wtemp
|
||||
|
||||
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
|
||||
res = dzero
|
||||
end if
|
||||
|
||||
@@ -1035,9 +1035,23 @@ contains
|
||||
real(psb_spk_) :: res
|
||||
integer(psb_ipk_) :: info
|
||||
|
||||
if (allocated(x%v).and.allocated(w%v)) then
|
||||
call w%v%mlt(x%v,info)
|
||||
res = w%v%nrm2(n)
|
||||
! Temp vectors
|
||||
type(psb_s_vect_type) :: wtemp
|
||||
|
||||
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
|
||||
res = szero
|
||||
end if
|
||||
@@ -1053,10 +1067,27 @@ contains
|
||||
real(psb_spk_) :: res
|
||||
integer(psb_ipk_) :: info
|
||||
|
||||
if (allocated(x%v).and.allocated(w%v).and.allocated(id%v)) then
|
||||
where( abs(id%v%v) <= szero) x%v%v = szero
|
||||
call w%v%mlt(x%v,info)
|
||||
res = w%v%nrm2(n)
|
||||
! Temp vectors
|
||||
type(psb_s_vect_type) :: wtemp
|
||||
|
||||
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
|
||||
res = szero
|
||||
end if
|
||||
|
||||
@@ -1028,9 +1028,23 @@ contains
|
||||
real(psb_dpk_) :: res
|
||||
integer(psb_ipk_) :: info
|
||||
|
||||
if (allocated(x%v).and.allocated(w%v)) then
|
||||
call w%v%mlt(x%v,info)
|
||||
res = w%v%nrm2(n)
|
||||
! Temp vectors
|
||||
type(psb_z_vect_type) :: wtemp
|
||||
|
||||
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
|
||||
res = dzero
|
||||
end if
|
||||
@@ -1046,10 +1060,27 @@ contains
|
||||
real(psb_dpk_) :: res
|
||||
integer(psb_ipk_) :: info
|
||||
|
||||
if (allocated(x%v).and.allocated(w%v).and.allocated(id%v)) then
|
||||
where( abs(id%v%v) <= dzero) x%v%v = dzero
|
||||
call w%v%mlt(x%v,info)
|
||||
res = w%v%nrm2(n)
|
||||
! Temp vectors
|
||||
type(psb_z_vect_type) :: wtemp
|
||||
|
||||
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
|
||||
res = dzero
|
||||
end if
|
||||
|
||||
Reference in New Issue
Block a user