|
|
|
@ -19,37 +19,35 @@ subroutine d_oacc_mlt_v_2(alpha, x, y, beta, z, info, conjgx, conjgy)
|
|
|
|
|
n = min(x%get_nrows(), y%get_nrows(), z%get_nrows())
|
|
|
|
|
|
|
|
|
|
info = 0
|
|
|
|
|
!!$ select type(xx => x)
|
|
|
|
|
!!$ class is (psb_d_vect_oacc)
|
|
|
|
|
!!$ select type (yy => y)
|
|
|
|
|
!!$ class is (psb_d_vect_oacc)
|
|
|
|
|
!!$ if (xx%is_host()) call xx%sync_space()
|
|
|
|
|
!!$ if (yy%is_host()) call yy%sync_space()
|
|
|
|
|
!!$ if ((beta /= dzero) .and. (z%is_host())) call z%sync_space()
|
|
|
|
|
!!$ !$acc parallel loop
|
|
|
|
|
!!$ do i = 1, n
|
|
|
|
|
!!$ z%v(i) = alpha * xx%v(i) * yy%v(i) + beta * z%v(i)
|
|
|
|
|
!!$ end do
|
|
|
|
|
!!$ call z%set_dev()
|
|
|
|
|
!!$ class default
|
|
|
|
|
!!$ if (xx%is_dev()) call xx%sync_space()
|
|
|
|
|
!!$ if (yy%is_dev()) call yy%sync()
|
|
|
|
|
!!$ if ((beta /= dzero) .and. (z%is_dev())) call z%sync_space()
|
|
|
|
|
!!$ !$acc parallel loop
|
|
|
|
|
!!$ do i = 1, n
|
|
|
|
|
!!$ z%v(i) = alpha * xx%v(i) * yy%v(i) + beta * z%v(i)
|
|
|
|
|
!!$ end do
|
|
|
|
|
!!$ call z%set_host()
|
|
|
|
|
!!$ end select
|
|
|
|
|
!!$ class default
|
|
|
|
|
!!$ if (x%is_dev()) call x%sync()
|
|
|
|
|
!!$ if (y%is_dev()) call y%sync()
|
|
|
|
|
!!$ if ((beta /= dzero) .and. (z%is_dev())) call z%sync_space()
|
|
|
|
|
!!$ !$acc parallel loop
|
|
|
|
|
!!$ do i = 1, n
|
|
|
|
|
!!$ z%v(i) = alpha * x%v(i) * y%v(i) + beta * z%v(i)
|
|
|
|
|
!!$ end do
|
|
|
|
|
!!$ call z%set_host()
|
|
|
|
|
!!$ end select
|
|
|
|
|
select type(xx => x)
|
|
|
|
|
class is (psb_d_vect_oacc)
|
|
|
|
|
select type (yy => y)
|
|
|
|
|
class is (psb_d_vect_oacc)
|
|
|
|
|
if (xx%is_host()) call xx%sync()
|
|
|
|
|
if (yy%is_host()) call yy%sync()
|
|
|
|
|
if ((beta /= dzero) .and. (z%is_host())) call z%sync()
|
|
|
|
|
!$acc parallel loop
|
|
|
|
|
do i = 1, n
|
|
|
|
|
z%v(i) = alpha * xx%v(i) * yy%v(i) + beta * z%v(i)
|
|
|
|
|
end do
|
|
|
|
|
call z%set_dev()
|
|
|
|
|
class default
|
|
|
|
|
if (xx%is_dev()) call xx%sync()
|
|
|
|
|
if (yy%is_dev()) call yy%sync()
|
|
|
|
|
if ((beta /= dzero) .and. (z%is_dev())) call z%sync()
|
|
|
|
|
do i = 1, n
|
|
|
|
|
z%v(i) = alpha * xx%v(i) * yy%v(i) + beta * z%v(i)
|
|
|
|
|
end do
|
|
|
|
|
call z%set_host()
|
|
|
|
|
end select
|
|
|
|
|
class default
|
|
|
|
|
if (x%is_dev()) call x%sync()
|
|
|
|
|
if (y%is_dev()) call y%sync()
|
|
|
|
|
if ((beta /= dzero) .and. (z%is_dev())) call z%sync()
|
|
|
|
|
do i = 1, n
|
|
|
|
|
z%v(i) = alpha * x%v(i) * y%v(i) + beta * z%v(i)
|
|
|
|
|
end do
|
|
|
|
|
call z%set_host()
|
|
|
|
|
end select
|
|
|
|
|
end subroutine d_oacc_mlt_v_2
|
|
|
|
|
|
|
|
|
|