Change name sync|free space, unify allocate impl

oacc_loloum
sfilippone 7 months ago
parent 479135c62d
commit fbb974fb8b

@ -15,14 +15,8 @@ contains
info = psb_success_
call a%psb_c_csr_sparse_mat%allocate(m, n, nz)
if (.not.allocated(a%val)) then
allocate(a%val(nz))
allocate(a%ja(nz))
allocate(a%irp(m+1))
end if
call a%set_dev()
call a%set_host()
call a%sync_dev_space()
if (info /= 0) goto 9999
call psb_erractionrestore(err_act)

@ -10,10 +10,10 @@ contains
info = psb_success_
call a%free_space()
call a%free_dev_space()
call a%psb_c_csr_sparse_mat%cp_from_coo(b, info)
if (info /= 0) goto 9999
call a%sync_space()
call a%sync_dev_space()
call a%set_host()
call a%sync()

@ -14,10 +14,10 @@ contains
type is (psb_c_coo_sparse_mat)
call a%cp_from_coo(b, info)
class default
call a%free_space()
call a%free_dev_space()
call a%psb_c_csr_sparse_mat%cp_from_fmt(b, info)
if (info /= 0) return
call a%sync_space()
call a%sync_dev_space()
call a%set_host()
call a%sync()
end select

@ -10,10 +10,10 @@ contains
info = psb_success_
call a%free_space()
call a%free_dev_space()
call a%psb_c_csr_sparse_mat%mv_from_coo(b, info)
if (info /= 0) goto 9999
call a%sync_space()
call a%sync_dev_space()
call a%set_host()
call a%sync()

@ -14,10 +14,10 @@ contains
type is (psb_c_coo_sparse_mat)
call a%mv_from_coo(b, info)
class default
call a%free_space()
call a%free_dev_space()
call a%psb_c_csr_sparse_mat%mv_from_fmt(b, info)
if (info /= 0) return
call a%sync_space()
call a%sync_dev_space()
call a%set_host()
call a%sync()
end select

@ -14,8 +14,8 @@ contains
info = psb_success_
call a%psb_c_csr_sparse_mat%reallocate(nz)
call a%set_dev()
call a%sync_dev_space()
call a%set_host()
if (info /= 0) goto 9999
call psb_erractionrestore(err_act)

@ -21,20 +21,8 @@ contains
end if
call a%psb_c_ell_sparse_mat%allocate(m, n, nz_)
if (.not.allocated(a%val)) then
allocate(a%val(m, nz_))
allocate(a%ja(m, nz_))
allocate(a%irn(m))
allocate(a%idiag(m))
end if
a%val = czero
a%ja = -1
a%irn = 0
a%idiag = 0
call a%set_dev()
call a%sync_dev_space()
call a%set_host()
if (info /= 0) goto 9999
call psb_erractionrestore(err_act)

@ -10,10 +10,10 @@ contains
info = psb_success_
call a%free_space()
call a%free_dev_space()
call a%psb_c_ell_sparse_mat%cp_from_coo(b, info)
if (info /= 0) goto 9999
call a%sync_space()
call a%sync_dev_space()
call a%set_host()
call a%sync()

@ -14,10 +14,10 @@ contains
type is (psb_c_coo_sparse_mat)
call a%cp_from_coo(b, info)
class default
call a%free_space()
call a%free_dev_space()
call a%psb_c_ell_sparse_mat%cp_from_fmt(b, info)
if (info /= 0) return
call a%sync_space()
call a%sync_dev_space()
call a%set_host()
call a%sync()
end select

@ -10,10 +10,10 @@ contains
info = psb_success_
call a%free_space()
call a%free_dev_space()
call a%psb_c_ell_sparse_mat%mv_from_coo(b, info)
if (info /= 0) goto 9999
call a%sync_space()
call a%sync_dev_space()
call a%set_host()
call a%sync()

@ -14,10 +14,10 @@ contains
type is (psb_c_coo_sparse_mat)
call a%mv_from_coo(b, info)
class default
call a%free_space()
call a%free_dev_space()
call a%psb_c_ell_sparse_mat%mv_from_fmt(b, info)
if (info /= 0) return
call a%sync_space()
call a%sync_dev_space()
call a%set_host()
call a%sync()
end select

@ -14,8 +14,8 @@ contains
info = psb_success_
call a%psb_c_ell_sparse_mat%reallocate(nz)
call a%set_dev()
call a%sync_dev_space()
call a%set_host()
if (info /= 0) goto 9999
call psb_erractionrestore(err_act)

@ -22,25 +22,8 @@ contains
end if
call a%psb_c_hll_sparse_mat%allocate(m, n, nz_)
hksz = a%hksz
nhacks = (m + hksz - 1) / hksz
if (.not.allocated(a%val)) then
allocate(a%val(nz_ * m))
allocate(a%ja(nz_ * m))
allocate(a%irn(m))
allocate(a%idiag(m))
allocate(a%hkoffs(nhacks))
end if
a%val = czero
a%ja = -1
a%irn = 0
a%idiag = 0
a%hkoffs = 0
call a%set_dev()
call a%sync_dev_space()
call a%set_host()
if (info /= 0) goto 9999
call psb_erractionrestore(err_act)

@ -10,10 +10,10 @@ contains
info = psb_success_
call a%free_space()
call a%free_dev_space()
call a%psb_c_hll_sparse_mat%cp_from_coo(b, info)
if (info /= 0) goto 9999
call a%sync_space()
call a%sync_dev_space()
call a%set_host()
call a%sync()

@ -14,10 +14,10 @@ contains
type is (psb_c_coo_sparse_mat)
call a%cp_from_coo(b, info)
class default
call a%free_space()
call a%free_dev_space()
call a%psb_c_hll_sparse_mat%cp_from_fmt(b, info)
if (info /= 0) return
call a%sync_space()
call a%sync_dev_space()
call a%set_host()
call a%sync()
end select

@ -10,10 +10,10 @@ contains
info = psb_success_
call a%free_space()
call a%free_dev_space()
call a%psb_c_hll_sparse_mat%mv_from_coo(b, info)
if (info /= 0) goto 9999
call a%sync_space()
call a%sync_dev_space()
call a%set_host()
call a%sync()

@ -14,10 +14,10 @@ contains
type is (psb_c_coo_sparse_mat)
call a%mv_from_coo(b, info)
class default
call a%free_space()
call a%free_dev_space()
call a%psb_c_hll_sparse_mat%mv_from_fmt(b, info)
if (info /= 0) return
call a%sync_space()
call a%sync_dev_space()
call a%set_host()
call a%sync()
end select

@ -15,8 +15,8 @@ contains
info = psb_success_
call a%psb_c_hll_sparse_mat%reallocate(nz)
call a%set_dev()
call a%sync_dev_space()
call a%set_host()
if (info /= 0) goto 9999
call psb_erractionrestore(err_act)

@ -15,14 +15,8 @@ contains
info = psb_success_
call a%psb_d_csr_sparse_mat%allocate(m, n, nz)
if (.not.allocated(a%val)) then
allocate(a%val(nz))
allocate(a%ja(nz))
allocate(a%irp(m+1))
end if
call a%set_dev()
call a%set_host()
call a%sync_dev_space()
if (info /= 0) goto 9999
call psb_erractionrestore(err_act)

@ -10,10 +10,10 @@ contains
info = psb_success_
call a%free_space()
call a%free_dev_space()
call a%psb_d_csr_sparse_mat%cp_from_coo(b, info)
if (info /= 0) goto 9999
call a%sync_space()
call a%sync_dev_space()
call a%set_host()
call a%sync()

@ -14,10 +14,10 @@ contains
type is (psb_d_coo_sparse_mat)
call a%cp_from_coo(b, info)
class default
call a%free_space()
call a%free_dev_space()
call a%psb_d_csr_sparse_mat%cp_from_fmt(b, info)
if (info /= 0) return
call a%sync_space()
call a%sync_dev_space()
call a%set_host()
call a%sync()
end select

@ -10,10 +10,10 @@ contains
info = psb_success_
call a%free_space()
call a%free_dev_space()
call a%psb_d_csr_sparse_mat%mv_from_coo(b, info)
if (info /= 0) goto 9999
call a%sync_space()
call a%sync_dev_space()
call a%set_host()
call a%sync()

@ -14,10 +14,10 @@ contains
type is (psb_d_coo_sparse_mat)
call a%mv_from_coo(b, info)
class default
call a%free_space()
call a%free_dev_space()
call a%psb_d_csr_sparse_mat%mv_from_fmt(b, info)
if (info /= 0) return
call a%sync_space()
call a%sync_dev_space()
call a%set_host()
call a%sync()
end select

@ -14,8 +14,8 @@ contains
info = psb_success_
call a%psb_d_csr_sparse_mat%reallocate(nz)
call a%set_dev()
call a%sync_dev_space()
call a%set_host()
if (info /= 0) goto 9999
call psb_erractionrestore(err_act)

@ -21,20 +21,8 @@ contains
end if
call a%psb_d_ell_sparse_mat%allocate(m, n, nz_)
if (.not.allocated(a%val)) then
allocate(a%val(m, nz_))
allocate(a%ja(m, nz_))
allocate(a%irn(m))
allocate(a%idiag(m))
end if
a%val = dzero
a%ja = -1
a%irn = 0
a%idiag = 0
call a%set_dev()
call a%sync_dev_space()
call a%set_host()
if (info /= 0) goto 9999
call psb_erractionrestore(err_act)

@ -10,10 +10,10 @@ contains
info = psb_success_
call a%free_space()
call a%free_dev_space()
call a%psb_d_ell_sparse_mat%cp_from_coo(b, info)
if (info /= 0) goto 9999
call a%sync_space()
call a%sync_dev_space()
call a%set_host()
call a%sync()

@ -14,10 +14,10 @@ contains
type is (psb_d_coo_sparse_mat)
call a%cp_from_coo(b, info)
class default
call a%free_space()
call a%free_dev_space()
call a%psb_d_ell_sparse_mat%cp_from_fmt(b, info)
if (info /= 0) return
call a%sync_space()
call a%sync_dev_space()
call a%set_host()
call a%sync()
end select

@ -10,10 +10,10 @@ contains
info = psb_success_
call a%free_space()
call a%free_dev_space()
call a%psb_d_ell_sparse_mat%mv_from_coo(b, info)
if (info /= 0) goto 9999
call a%sync_space()
call a%sync_dev_space()
call a%set_host()
call a%sync()

@ -14,10 +14,10 @@ contains
type is (psb_d_coo_sparse_mat)
call a%mv_from_coo(b, info)
class default
call a%free_space()
call a%free_dev_space()
call a%psb_d_ell_sparse_mat%mv_from_fmt(b, info)
if (info /= 0) return
call a%sync_space()
call a%sync_dev_space()
call a%set_host()
call a%sync()
end select

@ -14,8 +14,8 @@ contains
info = psb_success_
call a%psb_d_ell_sparse_mat%reallocate(nz)
call a%set_dev()
call a%sync_dev_space()
call a%set_host()
if (info /= 0) goto 9999
call psb_erractionrestore(err_act)

@ -22,25 +22,8 @@ contains
end if
call a%psb_d_hll_sparse_mat%allocate(m, n, nz_)
hksz = a%hksz
nhacks = (m + hksz - 1) / hksz
if (.not.allocated(a%val)) then
allocate(a%val(nz_ * m))
allocate(a%ja(nz_ * m))
allocate(a%irn(m))
allocate(a%idiag(m))
allocate(a%hkoffs(nhacks))
end if
a%val = dzero
a%ja = -1
a%irn = 0
a%idiag = 0
a%hkoffs = 0
call a%set_dev()
call a%sync_dev_space()
call a%set_host()
if (info /= 0) goto 9999
call psb_erractionrestore(err_act)

@ -10,10 +10,10 @@ contains
info = psb_success_
call a%free_space()
call a%free_dev_space()
call a%psb_d_hll_sparse_mat%cp_from_coo(b, info)
if (info /= 0) goto 9999
call a%sync_space()
call a%sync_dev_space()
call a%set_host()
call a%sync()

@ -14,10 +14,10 @@ contains
type is (psb_d_coo_sparse_mat)
call a%cp_from_coo(b, info)
class default
call a%free_space()
call a%free_dev_space()
call a%psb_d_hll_sparse_mat%cp_from_fmt(b, info)
if (info /= 0) return
call a%sync_space()
call a%sync_dev_space()
call a%set_host()
call a%sync()
end select

@ -10,10 +10,10 @@ contains
info = psb_success_
call a%free_space()
call a%free_dev_space()
call a%psb_d_hll_sparse_mat%mv_from_coo(b, info)
if (info /= 0) goto 9999
call a%sync_space()
call a%sync_dev_space()
call a%set_host()
call a%sync()

@ -14,10 +14,10 @@ contains
type is (psb_d_coo_sparse_mat)
call a%mv_from_coo(b, info)
class default
call a%free_space()
call a%free_dev_space()
call a%psb_d_hll_sparse_mat%mv_from_fmt(b, info)
if (info /= 0) return
call a%sync_space()
call a%sync_dev_space()
call a%set_host()
call a%sync()
end select

@ -15,8 +15,8 @@ contains
info = psb_success_
call a%psb_d_hll_sparse_mat%reallocate(nz)
call a%set_dev()
call a%sync_dev_space()
call a%set_host()
if (info /= 0) goto 9999
call psb_erractionrestore(err_act)

@ -15,14 +15,8 @@ contains
info = psb_success_
call a%psb_s_csr_sparse_mat%allocate(m, n, nz)
if (.not.allocated(a%val)) then
allocate(a%val(nz))
allocate(a%ja(nz))
allocate(a%irp(m+1))
end if
call a%set_dev()
call a%set_host()
call a%sync_dev_space()
if (info /= 0) goto 9999
call psb_erractionrestore(err_act)

@ -10,10 +10,10 @@ contains
info = psb_success_
call a%free_space()
call a%free_dev_space()
call a%psb_s_csr_sparse_mat%cp_from_coo(b, info)
if (info /= 0) goto 9999
call a%sync_space()
call a%sync_dev_space()
call a%set_host()
call a%sync()

@ -14,10 +14,10 @@ contains
type is (psb_s_coo_sparse_mat)
call a%cp_from_coo(b, info)
class default
call a%free_space()
call a%free_dev_space()
call a%psb_s_csr_sparse_mat%cp_from_fmt(b, info)
if (info /= 0) return
call a%sync_space()
call a%sync_dev_space()
call a%set_host()
call a%sync()
end select

@ -10,10 +10,10 @@ contains
info = psb_success_
call a%free_space()
call a%free_dev_space()
call a%psb_s_csr_sparse_mat%mv_from_coo(b, info)
if (info /= 0) goto 9999
call a%sync_space()
call a%sync_dev_space()
call a%set_host()
call a%sync()

@ -14,10 +14,10 @@ contains
type is (psb_s_coo_sparse_mat)
call a%mv_from_coo(b, info)
class default
call a%free_space()
call a%free_dev_space()
call a%psb_s_csr_sparse_mat%mv_from_fmt(b, info)
if (info /= 0) return
call a%sync_space()
call a%sync_dev_space()
call a%set_host()
call a%sync()
end select

@ -14,8 +14,8 @@ contains
info = psb_success_
call a%psb_s_csr_sparse_mat%reallocate(nz)
call a%set_dev()
call a%sync_dev_space()
call a%set_host()
if (info /= 0) goto 9999
call psb_erractionrestore(err_act)

@ -21,20 +21,8 @@ contains
end if
call a%psb_s_ell_sparse_mat%allocate(m, n, nz_)
if (.not.allocated(a%val)) then
allocate(a%val(m, nz_))
allocate(a%ja(m, nz_))
allocate(a%irn(m))
allocate(a%idiag(m))
end if
a%val = szero
a%ja = -1
a%irn = 0
a%idiag = 0
call a%set_dev()
call a%sync_dev_space()
call a%set_host()
if (info /= 0) goto 9999
call psb_erractionrestore(err_act)

@ -10,10 +10,10 @@ contains
info = psb_success_
call a%free_space()
call a%free_dev_space()
call a%psb_s_ell_sparse_mat%cp_from_coo(b, info)
if (info /= 0) goto 9999
call a%sync_space()
call a%sync_dev_space()
call a%set_host()
call a%sync()

@ -14,10 +14,10 @@ contains
type is (psb_s_coo_sparse_mat)
call a%cp_from_coo(b, info)
class default
call a%free_space()
call a%free_dev_space()
call a%psb_s_ell_sparse_mat%cp_from_fmt(b, info)
if (info /= 0) return
call a%sync_space()
call a%sync_dev_space()
call a%set_host()
call a%sync()
end select

@ -10,10 +10,10 @@ contains
info = psb_success_
call a%free_space()
call a%free_dev_space()
call a%psb_s_ell_sparse_mat%mv_from_coo(b, info)
if (info /= 0) goto 9999
call a%sync_space()
call a%sync_dev_space()
call a%set_host()
call a%sync()

@ -14,10 +14,10 @@ contains
type is (psb_s_coo_sparse_mat)
call a%mv_from_coo(b, info)
class default
call a%free_space()
call a%free_dev_space()
call a%psb_s_ell_sparse_mat%mv_from_fmt(b, info)
if (info /= 0) return
call a%sync_space()
call a%sync_dev_space()
call a%set_host()
call a%sync()
end select

@ -14,8 +14,8 @@ contains
info = psb_success_
call a%psb_s_ell_sparse_mat%reallocate(nz)
call a%set_dev()
call a%sync_dev_space()
call a%set_host()
if (info /= 0) goto 9999
call psb_erractionrestore(err_act)

@ -22,25 +22,8 @@ contains
end if
call a%psb_s_hll_sparse_mat%allocate(m, n, nz_)
hksz = a%hksz
nhacks = (m + hksz - 1) / hksz
if (.not.allocated(a%val)) then
allocate(a%val(nz_ * m))
allocate(a%ja(nz_ * m))
allocate(a%irn(m))
allocate(a%idiag(m))
allocate(a%hkoffs(nhacks))
end if
a%val = szero
a%ja = -1
a%irn = 0
a%idiag = 0
a%hkoffs = 0
call a%set_dev()
call a%sync_dev_space()
call a%set_host()
if (info /= 0) goto 9999
call psb_erractionrestore(err_act)

@ -10,10 +10,10 @@ contains
info = psb_success_
call a%free_space()
call a%free_dev_space()
call a%psb_s_hll_sparse_mat%cp_from_coo(b, info)
if (info /= 0) goto 9999
call a%sync_space()
call a%sync_dev_space()
call a%set_host()
call a%sync()

@ -14,10 +14,10 @@ contains
type is (psb_s_coo_sparse_mat)
call a%cp_from_coo(b, info)
class default
call a%free_space()
call a%free_dev_space()
call a%psb_s_hll_sparse_mat%cp_from_fmt(b, info)
if (info /= 0) return
call a%sync_space()
call a%sync_dev_space()
call a%set_host()
call a%sync()
end select

@ -10,10 +10,10 @@ contains
info = psb_success_
call a%free_space()
call a%free_dev_space()
call a%psb_s_hll_sparse_mat%mv_from_coo(b, info)
if (info /= 0) goto 9999
call a%sync_space()
call a%sync_dev_space()
call a%set_host()
call a%sync()

@ -14,10 +14,10 @@ contains
type is (psb_s_coo_sparse_mat)
call a%mv_from_coo(b, info)
class default
call a%free_space()
call a%free_dev_space()
call a%psb_s_hll_sparse_mat%mv_from_fmt(b, info)
if (info /= 0) return
call a%sync_space()
call a%sync_dev_space()
call a%set_host()
call a%sync()
end select

@ -15,8 +15,8 @@ contains
info = psb_success_
call a%psb_s_hll_sparse_mat%reallocate(nz)
call a%set_dev()
call a%sync_dev_space()
call a%set_host()
if (info /= 0) goto 9999
call psb_erractionrestore(err_act)

@ -15,14 +15,8 @@ contains
info = psb_success_
call a%psb_z_csr_sparse_mat%allocate(m, n, nz)
if (.not.allocated(a%val)) then
allocate(a%val(nz))
allocate(a%ja(nz))
allocate(a%irp(m+1))
end if
call a%set_dev()
call a%set_host()
call a%sync_dev_space()
if (info /= 0) goto 9999
call psb_erractionrestore(err_act)

@ -10,10 +10,10 @@ contains
info = psb_success_
call a%free_space()
call a%free_dev_space()
call a%psb_z_csr_sparse_mat%cp_from_coo(b, info)
if (info /= 0) goto 9999
call a%sync_space()
call a%sync_dev_space()
call a%set_host()
call a%sync()

@ -14,10 +14,10 @@ contains
type is (psb_z_coo_sparse_mat)
call a%cp_from_coo(b, info)
class default
call a%free_space()
call a%free_dev_space()
call a%psb_z_csr_sparse_mat%cp_from_fmt(b, info)
if (info /= 0) return
call a%sync_space()
call a%sync_dev_space()
call a%set_host()
call a%sync()
end select

@ -10,10 +10,10 @@ contains
info = psb_success_
call a%free_space()
call a%free_dev_space()
call a%psb_z_csr_sparse_mat%mv_from_coo(b, info)
if (info /= 0) goto 9999
call a%sync_space()
call a%sync_dev_space()
call a%set_host()
call a%sync()

@ -14,10 +14,10 @@ contains
type is (psb_z_coo_sparse_mat)
call a%mv_from_coo(b, info)
class default
call a%free_space()
call a%free_dev_space()
call a%psb_z_csr_sparse_mat%mv_from_fmt(b, info)
if (info /= 0) return
call a%sync_space()
call a%sync_dev_space()
call a%set_host()
call a%sync()
end select

@ -14,8 +14,8 @@ contains
info = psb_success_
call a%psb_z_csr_sparse_mat%reallocate(nz)
call a%set_dev()
call a%sync_dev_space()
call a%set_host()
if (info /= 0) goto 9999
call psb_erractionrestore(err_act)

@ -21,20 +21,8 @@ contains
end if
call a%psb_z_ell_sparse_mat%allocate(m, n, nz_)
if (.not.allocated(a%val)) then
allocate(a%val(m, nz_))
allocate(a%ja(m, nz_))
allocate(a%irn(m))
allocate(a%idiag(m))
end if
a%val = zzero
a%ja = -1
a%irn = 0
a%idiag = 0
call a%set_dev()
call a%sync_dev_space()
call a%set_host()
if (info /= 0) goto 9999
call psb_erractionrestore(err_act)

@ -10,10 +10,10 @@ contains
info = psb_success_
call a%free_space()
call a%free_dev_space()
call a%psb_z_ell_sparse_mat%cp_from_coo(b, info)
if (info /= 0) goto 9999
call a%sync_space()
call a%sync_dev_space()
call a%set_host()
call a%sync()

@ -14,10 +14,10 @@ contains
type is (psb_z_coo_sparse_mat)
call a%cp_from_coo(b, info)
class default
call a%free_space()
call a%free_dev_space()
call a%psb_z_ell_sparse_mat%cp_from_fmt(b, info)
if (info /= 0) return
call a%sync_space()
call a%sync_dev_space()
call a%set_host()
call a%sync()
end select

@ -10,10 +10,10 @@ contains
info = psb_success_
call a%free_space()
call a%free_dev_space()
call a%psb_z_ell_sparse_mat%mv_from_coo(b, info)
if (info /= 0) goto 9999
call a%sync_space()
call a%sync_dev_space()
call a%set_host()
call a%sync()

@ -14,10 +14,10 @@ contains
type is (psb_z_coo_sparse_mat)
call a%mv_from_coo(b, info)
class default
call a%free_space()
call a%free_dev_space()
call a%psb_z_ell_sparse_mat%mv_from_fmt(b, info)
if (info /= 0) return
call a%sync_space()
call a%sync_dev_space()
call a%set_host()
call a%sync()
end select

@ -14,8 +14,8 @@ contains
info = psb_success_
call a%psb_z_ell_sparse_mat%reallocate(nz)
call a%set_dev()
call a%sync_dev_space()
call a%set_host()
if (info /= 0) goto 9999
call psb_erractionrestore(err_act)

@ -22,25 +22,8 @@ contains
end if
call a%psb_z_hll_sparse_mat%allocate(m, n, nz_)
hksz = a%hksz
nhacks = (m + hksz - 1) / hksz
if (.not.allocated(a%val)) then
allocate(a%val(nz_ * m))
allocate(a%ja(nz_ * m))
allocate(a%irn(m))
allocate(a%idiag(m))
allocate(a%hkoffs(nhacks))
end if
a%val = zzero
a%ja = -1
a%irn = 0
a%idiag = 0
a%hkoffs = 0
call a%set_dev()
call a%sync_dev_space()
call a%set_host()
if (info /= 0) goto 9999
call psb_erractionrestore(err_act)

@ -10,10 +10,10 @@ contains
info = psb_success_
call a%free_space()
call a%free_dev_space()
call a%psb_z_hll_sparse_mat%cp_from_coo(b, info)
if (info /= 0) goto 9999
call a%sync_space()
call a%sync_dev_space()
call a%set_host()
call a%sync()

@ -14,10 +14,10 @@ contains
type is (psb_z_coo_sparse_mat)
call a%cp_from_coo(b, info)
class default
call a%free_space()
call a%free_dev_space()
call a%psb_z_hll_sparse_mat%cp_from_fmt(b, info)
if (info /= 0) return
call a%sync_space()
call a%sync_dev_space()
call a%set_host()
call a%sync()
end select

@ -10,10 +10,10 @@ contains
info = psb_success_
call a%free_space()
call a%free_dev_space()
call a%psb_z_hll_sparse_mat%mv_from_coo(b, info)
if (info /= 0) goto 9999
call a%sync_space()
call a%sync_dev_space()
call a%set_host()
call a%sync()

@ -14,10 +14,10 @@ contains
type is (psb_z_coo_sparse_mat)
call a%mv_from_coo(b, info)
class default
call a%free_space()
call a%free_dev_space()
call a%psb_z_hll_sparse_mat%mv_from_fmt(b, info)
if (info /= 0) return
call a%sync_space()
call a%sync_dev_space()
call a%set_host()
call a%sync()
end select

@ -15,8 +15,8 @@ contains
info = psb_success_
call a%psb_z_hll_sparse_mat%reallocate(nz)
call a%set_dev()
call a%sync_dev_space()
call a%set_host()
if (info /= 0) goto 9999
call psb_erractionrestore(err_act)

@ -36,8 +36,8 @@ module psb_c_oacc_csr_mat_mod
procedure, pass(a) :: set_host => c_oacc_csr_set_host
procedure, pass(a) :: set_sync => c_oacc_csr_set_sync
procedure, pass(a) :: set_dev => c_oacc_csr_set_dev
procedure, pass(a) :: free_space => c_oacc_csr_free_space
procedure, pass(a) :: sync_space => c_oacc_csr_sync_space
procedure, pass(a) :: free_dev_space => c_oacc_csr_free_dev_space
procedure, pass(a) :: sync_dev_space => c_oacc_csr_sync_dev_space
procedure, pass(a) :: sync => c_oacc_csr_sync
end type psb_c_oacc_csr_sparse_mat
@ -156,7 +156,7 @@ module psb_c_oacc_csr_mat_mod
contains
subroutine c_oacc_csr_free_space(a)
subroutine c_oacc_csr_free_dev_space(a)
use psb_base_mod
implicit none
class(psb_c_oacc_csr_sparse_mat), intent(inout) :: a
@ -167,7 +167,7 @@ contains
if (allocated(a%irp)) call acc_delete_finalize(a%irp)
return
end subroutine c_oacc_csr_free_space
end subroutine c_oacc_csr_free_dev_space
subroutine c_oacc_csr_free(a)
use psb_base_mod
@ -175,7 +175,7 @@ contains
class(psb_c_oacc_csr_sparse_mat), intent(inout) :: a
integer(psb_ipk_) :: info
call a%free_space()
call a%free_dev_space()
call a%psb_c_csr_sparse_mat%free()
return
@ -218,7 +218,7 @@ contains
allocate(a%ja(nz),stat=info)
allocate(a%irp(m+1),stat=info)
if (info == 0) call a%set_host()
if (info == 0) call a%sync_space()
if (info == 0) call a%sync_dev_space()
end subroutine c_oacc_csr_all
function c_oacc_csr_is_host(a) result(res)
@ -266,13 +266,13 @@ contains
a%devstate = is_dev
end subroutine c_oacc_csr_set_dev
subroutine c_oacc_csr_sync_space(a)
subroutine c_oacc_csr_sync_dev_space(a)
implicit none
class(psb_c_oacc_csr_sparse_mat), intent(inout) :: a
if (allocated(a%val)) call acc_create(a%val)
if (allocated(a%ja)) call acc_create(a%ja)
if (allocated(a%irp)) call acc_create(a%irp)
end subroutine c_oacc_csr_sync_space
end subroutine c_oacc_csr_sync_dev_space
subroutine c_oacc_csr_sync(a)
implicit none

@ -20,9 +20,9 @@ module psb_c_oacc_ell_mat_mod
procedure, pass(a) :: set_host => c_oacc_ell_set_host
procedure, pass(a) :: set_sync => c_oacc_ell_set_sync
procedure, pass(a) :: set_dev => c_oacc_ell_set_dev
procedure, pass(a) :: sync_space => c_oacc_ell_sync_space
procedure, pass(a) :: sync_dev_space => c_oacc_ell_sync_dev_space
procedure, pass(a) :: sync => c_oacc_ell_sync
procedure, pass(a) :: free_space => c_oacc_ell_free_space
procedure, pass(a) :: free_dev_space => c_oacc_ell_free_dev_space
procedure, pass(a) :: free => c_oacc_ell_free
procedure, pass(a) :: vect_mv => psb_c_oacc_ell_vect_mv
procedure, pass(a) :: in_vect_sv => psb_c_oacc_ell_inner_vect_sv
@ -154,7 +154,7 @@ module psb_c_oacc_ell_mat_mod
contains
subroutine c_oacc_ell_free_space(a)
subroutine c_oacc_ell_free_dev_space(a)
use psb_base_mod
implicit none
class(psb_c_oacc_ell_sparse_mat), intent(inout) :: a
@ -166,7 +166,7 @@ contains
if (allocated(a%idiag)) call acc_delete_finalize(a%idiag)
return
end subroutine c_oacc_ell_free_space
end subroutine c_oacc_ell_free_dev_space
subroutine c_oacc_ell_free(a)
use psb_base_mod
@ -174,7 +174,7 @@ contains
class(psb_c_oacc_ell_sparse_mat), intent(inout) :: a
integer(psb_ipk_) :: info
call a%free_space()
call a%free_dev_space()
call a%psb_c_ell_sparse_mat%free()
return
@ -195,7 +195,7 @@ contains
end function c_oacc_ell_sizeof
subroutine c_oacc_ell_sync_space(a)
subroutine c_oacc_ell_sync_dev_space(a)
implicit none
class(psb_c_oacc_ell_sparse_mat), intent(inout) :: a
@ -203,7 +203,7 @@ contains
if (allocated(a%ja)) call acc_create(a%ja)
if (allocated(a%irn)) call acc_create(a%irn)
if (allocated(a%idiag)) call acc_create(a%idiag)
end subroutine c_oacc_ell_sync_space
end subroutine c_oacc_ell_sync_dev_space
function c_oacc_ell_is_host(a) result(res)
implicit none

@ -20,9 +20,9 @@ module psb_c_oacc_hll_mat_mod
procedure, pass(a) :: set_host => c_oacc_hll_set_host
procedure, pass(a) :: set_sync => c_oacc_hll_set_sync
procedure, pass(a) :: set_dev => c_oacc_hll_set_dev
procedure, pass(a) :: sync_space => c_oacc_hll_sync_space
procedure, pass(a) :: sync_dev_space => c_oacc_hll_sync_dev_space
procedure, pass(a) :: sync => c_oacc_hll_sync
procedure, pass(a) :: free_space => c_oacc_hll_free_space
procedure, pass(a) :: free_dev_space => c_oacc_hll_free_dev_space
procedure, pass(a) :: free => c_oacc_hll_free
procedure, pass(a) :: vect_mv => psb_c_oacc_hll_vect_mv
procedure, pass(a) :: in_vect_sv => psb_c_oacc_hll_inner_vect_sv
@ -154,7 +154,7 @@ module psb_c_oacc_hll_mat_mod
contains
subroutine c_oacc_hll_free_space(a)
subroutine c_oacc_hll_free_dev_space(a)
use psb_base_mod
implicit none
class(psb_c_oacc_hll_sparse_mat), intent(inout) :: a
@ -167,7 +167,7 @@ contains
if (allocated(a%hkoffs)) call acc_delete_finalize(a%hkoffs)
return
end subroutine c_oacc_hll_free_space
end subroutine c_oacc_hll_free_dev_space
subroutine c_oacc_hll_free(a)
use psb_base_mod
@ -175,7 +175,7 @@ contains
class(psb_c_oacc_hll_sparse_mat), intent(inout) :: a
integer(psb_ipk_) :: info
call a%free_space()
call a%free_dev_space()
call a%psb_c_hll_sparse_mat%free()
return
@ -249,7 +249,7 @@ contains
res = 'HLLOA'
end function c_oacc_hll_get_fmt
subroutine c_oacc_hll_sync_space(a)
subroutine c_oacc_hll_sync_dev_space(a)
implicit none
class(psb_c_oacc_hll_sparse_mat), intent(inout) :: a
@ -258,7 +258,7 @@ contains
if (allocated(a%irn)) call acc_create(a%irn)
if (allocated(a%idiag)) call acc_create(a%idiag)
if (allocated(a%hkoffs)) call acc_create(a%hkoffs)
end subroutine c_oacc_hll_sync_space
end subroutine c_oacc_hll_sync_dev_space
subroutine c_oacc_hll_sync(a)

@ -22,7 +22,7 @@ module psb_c_oacc_vect_mod
procedure, pass(x) :: zero => c_oacc_zero
procedure, pass(x) :: asb_m => c_oacc_asb_m
procedure, pass(x) :: sync => c_oacc_sync
procedure, pass(x) :: sync_space => c_oacc_sync_space
procedure, pass(x) :: sync_dev_space => c_oacc_sync_dev_space
procedure, pass(x) :: bld_x => c_oacc_bld_x
procedure, pass(x) :: bld_mn => c_oacc_bld_mn
procedure, pass(x) :: free => c_oacc_vect_free
@ -611,7 +611,7 @@ contains
call psb_errpush(info, 'c_oacc_bld_mn', i_err=(/n, n, n, n, n/))
end if
call x%set_host()
call x%sync_space()
call x%sync_dev_space()
end subroutine c_oacc_bld_mn
@ -633,7 +633,7 @@ contains
end if
x%v(:) = this(:)
call x%set_host()
call x%sync_space()
call x%sync_dev_space()
end subroutine c_oacc_bld_x
@ -762,11 +762,11 @@ contains
end function c_oacc_dot_a
subroutine c_oacc_sync_space(x)
subroutine c_oacc_sync_dev_space(x)
implicit none
class(psb_c_vect_oacc), intent(inout) :: x
if (allocated(x%v)) call acc_create(x%v)
end subroutine c_oacc_sync_space
end subroutine c_oacc_sync_dev_space
subroutine c_oacc_sync(x)
implicit none
@ -840,7 +840,7 @@ contains
i_err=(/n, n, n, n, n/))
end if
call x%set_host()
call x%sync_space()
call x%sync_dev_space()
end subroutine c_oacc_vect_all
subroutine c_oacc_final_vect_free(x)

@ -36,8 +36,8 @@ module psb_d_oacc_csr_mat_mod
procedure, pass(a) :: set_host => d_oacc_csr_set_host
procedure, pass(a) :: set_sync => d_oacc_csr_set_sync
procedure, pass(a) :: set_dev => d_oacc_csr_set_dev
procedure, pass(a) :: free_space => d_oacc_csr_free_space
procedure, pass(a) :: sync_space => d_oacc_csr_sync_space
procedure, pass(a) :: free_dev_space => d_oacc_csr_free_dev_space
procedure, pass(a) :: sync_dev_space => d_oacc_csr_sync_dev_space
procedure, pass(a) :: sync => d_oacc_csr_sync
end type psb_d_oacc_csr_sparse_mat
@ -156,7 +156,7 @@ module psb_d_oacc_csr_mat_mod
contains
subroutine d_oacc_csr_free_space(a)
subroutine d_oacc_csr_free_dev_space(a)
use psb_base_mod
implicit none
class(psb_d_oacc_csr_sparse_mat), intent(inout) :: a
@ -167,7 +167,7 @@ contains
if (allocated(a%irp)) call acc_delete_finalize(a%irp)
return
end subroutine d_oacc_csr_free_space
end subroutine d_oacc_csr_free_dev_space
subroutine d_oacc_csr_free(a)
use psb_base_mod
@ -175,7 +175,7 @@ contains
class(psb_d_oacc_csr_sparse_mat), intent(inout) :: a
integer(psb_ipk_) :: info
call a%free_space()
call a%free_dev_space()
call a%psb_d_csr_sparse_mat%free()
return
@ -218,7 +218,7 @@ contains
allocate(a%ja(nz),stat=info)
allocate(a%irp(m+1),stat=info)
if (info == 0) call a%set_host()
if (info == 0) call a%sync_space()
if (info == 0) call a%sync_dev_space()
end subroutine d_oacc_csr_all
function d_oacc_csr_is_host(a) result(res)
@ -266,13 +266,13 @@ contains
a%devstate = is_dev
end subroutine d_oacc_csr_set_dev
subroutine d_oacc_csr_sync_space(a)
subroutine d_oacc_csr_sync_dev_space(a)
implicit none
class(psb_d_oacc_csr_sparse_mat), intent(inout) :: a
if (allocated(a%val)) call acc_create(a%val)
if (allocated(a%ja)) call acc_create(a%ja)
if (allocated(a%irp)) call acc_create(a%irp)
end subroutine d_oacc_csr_sync_space
end subroutine d_oacc_csr_sync_dev_space
subroutine d_oacc_csr_sync(a)
implicit none

@ -20,9 +20,9 @@ module psb_d_oacc_ell_mat_mod
procedure, pass(a) :: set_host => d_oacc_ell_set_host
procedure, pass(a) :: set_sync => d_oacc_ell_set_sync
procedure, pass(a) :: set_dev => d_oacc_ell_set_dev
procedure, pass(a) :: sync_space => d_oacc_ell_sync_space
procedure, pass(a) :: sync_dev_space => d_oacc_ell_sync_dev_space
procedure, pass(a) :: sync => d_oacc_ell_sync
procedure, pass(a) :: free_space => d_oacc_ell_free_space
procedure, pass(a) :: free_dev_space => d_oacc_ell_free_dev_space
procedure, pass(a) :: free => d_oacc_ell_free
procedure, pass(a) :: vect_mv => psb_d_oacc_ell_vect_mv
procedure, pass(a) :: in_vect_sv => psb_d_oacc_ell_inner_vect_sv
@ -154,7 +154,7 @@ module psb_d_oacc_ell_mat_mod
contains
subroutine d_oacc_ell_free_space(a)
subroutine d_oacc_ell_free_dev_space(a)
use psb_base_mod
implicit none
class(psb_d_oacc_ell_sparse_mat), intent(inout) :: a
@ -166,7 +166,7 @@ contains
if (allocated(a%idiag)) call acc_delete_finalize(a%idiag)
return
end subroutine d_oacc_ell_free_space
end subroutine d_oacc_ell_free_dev_space
subroutine d_oacc_ell_free(a)
use psb_base_mod
@ -174,7 +174,7 @@ contains
class(psb_d_oacc_ell_sparse_mat), intent(inout) :: a
integer(psb_ipk_) :: info
call a%free_space()
call a%free_dev_space()
call a%psb_d_ell_sparse_mat%free()
return
@ -195,7 +195,7 @@ contains
end function d_oacc_ell_sizeof
subroutine d_oacc_ell_sync_space(a)
subroutine d_oacc_ell_sync_dev_space(a)
implicit none
class(psb_d_oacc_ell_sparse_mat), intent(inout) :: a
@ -203,7 +203,7 @@ contains
if (allocated(a%ja)) call acc_create(a%ja)
if (allocated(a%irn)) call acc_create(a%irn)
if (allocated(a%idiag)) call acc_create(a%idiag)
end subroutine d_oacc_ell_sync_space
end subroutine d_oacc_ell_sync_dev_space
function d_oacc_ell_is_host(a) result(res)
implicit none

@ -20,9 +20,9 @@ module psb_d_oacc_hll_mat_mod
procedure, pass(a) :: set_host => d_oacc_hll_set_host
procedure, pass(a) :: set_sync => d_oacc_hll_set_sync
procedure, pass(a) :: set_dev => d_oacc_hll_set_dev
procedure, pass(a) :: sync_space => d_oacc_hll_sync_space
procedure, pass(a) :: sync_dev_space => d_oacc_hll_sync_dev_space
procedure, pass(a) :: sync => d_oacc_hll_sync
procedure, pass(a) :: free_space => d_oacc_hll_free_space
procedure, pass(a) :: free_dev_space => d_oacc_hll_free_dev_space
procedure, pass(a) :: free => d_oacc_hll_free
procedure, pass(a) :: vect_mv => psb_d_oacc_hll_vect_mv
procedure, pass(a) :: in_vect_sv => psb_d_oacc_hll_inner_vect_sv
@ -154,7 +154,7 @@ module psb_d_oacc_hll_mat_mod
contains
subroutine d_oacc_hll_free_space(a)
subroutine d_oacc_hll_free_dev_space(a)
use psb_base_mod
implicit none
class(psb_d_oacc_hll_sparse_mat), intent(inout) :: a
@ -167,7 +167,7 @@ contains
if (allocated(a%hkoffs)) call acc_delete_finalize(a%hkoffs)
return
end subroutine d_oacc_hll_free_space
end subroutine d_oacc_hll_free_dev_space
subroutine d_oacc_hll_free(a)
use psb_base_mod
@ -175,7 +175,7 @@ contains
class(psb_d_oacc_hll_sparse_mat), intent(inout) :: a
integer(psb_ipk_) :: info
call a%free_space()
call a%free_dev_space()
call a%psb_d_hll_sparse_mat%free()
return
@ -249,7 +249,7 @@ contains
res = 'HLLOA'
end function d_oacc_hll_get_fmt
subroutine d_oacc_hll_sync_space(a)
subroutine d_oacc_hll_sync_dev_space(a)
implicit none
class(psb_d_oacc_hll_sparse_mat), intent(inout) :: a
@ -258,7 +258,7 @@ contains
if (allocated(a%irn)) call acc_create(a%irn)
if (allocated(a%idiag)) call acc_create(a%idiag)
if (allocated(a%hkoffs)) call acc_create(a%hkoffs)
end subroutine d_oacc_hll_sync_space
end subroutine d_oacc_hll_sync_dev_space
subroutine d_oacc_hll_sync(a)

@ -22,7 +22,7 @@ module psb_d_oacc_vect_mod
procedure, pass(x) :: zero => d_oacc_zero
procedure, pass(x) :: asb_m => d_oacc_asb_m
procedure, pass(x) :: sync => d_oacc_sync
procedure, pass(x) :: sync_space => d_oacc_sync_space
procedure, pass(x) :: sync_dev_space => d_oacc_sync_dev_space
procedure, pass(x) :: bld_x => d_oacc_bld_x
procedure, pass(x) :: bld_mn => d_oacc_bld_mn
procedure, pass(x) :: free => d_oacc_vect_free
@ -611,7 +611,7 @@ contains
call psb_errpush(info, 'd_oacc_bld_mn', i_err=(/n, n, n, n, n/))
end if
call x%set_host()
call x%sync_space()
call x%sync_dev_space()
end subroutine d_oacc_bld_mn
@ -633,7 +633,7 @@ contains
end if
x%v(:) = this(:)
call x%set_host()
call x%sync_space()
call x%sync_dev_space()
end subroutine d_oacc_bld_x
@ -762,11 +762,11 @@ contains
end function d_oacc_dot_a
subroutine d_oacc_sync_space(x)
subroutine d_oacc_sync_dev_space(x)
implicit none
class(psb_d_vect_oacc), intent(inout) :: x
if (allocated(x%v)) call acc_create(x%v)
end subroutine d_oacc_sync_space
end subroutine d_oacc_sync_dev_space
subroutine d_oacc_sync(x)
implicit none
@ -840,7 +840,7 @@ contains
i_err=(/n, n, n, n, n/))
end if
call x%set_host()
call x%sync_space()
call x%sync_dev_space()
end subroutine d_oacc_vect_all
subroutine d_oacc_final_vect_free(x)

@ -20,7 +20,7 @@ module psb_i_oacc_vect_mod
procedure, pass(x) :: zero => i_oacc_zero
procedure, pass(x) :: asb_m => i_oacc_asb_m
procedure, pass(x) :: sync => i_oacc_sync
procedure, pass(x) :: sync_space => i_oacc_sync_space
procedure, pass(x) :: sync_dev_space => i_oacc_sync_dev_space
procedure, pass(x) :: bld_x => i_oacc_bld_x
procedure, pass(x) :: bld_mn => i_oacc_bld_mn
procedure, pass(x) :: free => i_oacc_vect_free
@ -269,7 +269,7 @@ contains
call psb_errpush(info, 'i_oacc_bld_mn', i_err=(/n, n, n, n, n/))
end if
call x%set_host()
call x%sync_space()
call x%sync_dev_space()
end subroutine i_oacc_bld_mn
@ -291,7 +291,7 @@ contains
end if
x%v(:) = this(:)
call x%set_host()
call x%sync_space()
call x%sync_dev_space()
end subroutine i_oacc_bld_x
@ -366,11 +366,11 @@ contains
end function i_oacc_get_fmt
subroutine i_oacc_sync_space(x)
subroutine i_oacc_sync_dev_space(x)
implicit none
class(psb_i_vect_oacc), intent(inout) :: x
if (allocated(x%v)) call acc_create(x%v)
end subroutine i_oacc_sync_space
end subroutine i_oacc_sync_dev_space
subroutine i_oacc_sync(x)
implicit none
@ -444,7 +444,7 @@ contains
i_err=(/n, n, n, n, n/))
end if
call x%set_host()
call x%sync_space()
call x%sync_dev_space()
end subroutine i_oacc_vect_all
subroutine i_oacc_final_vect_free(x)

@ -22,7 +22,7 @@ module psb_l_oacc_vect_mod
procedure, pass(x) :: zero => l_oacc_zero
procedure, pass(x) :: asb_m => l_oacc_asb_m
procedure, pass(x) :: sync => l_oacc_sync
procedure, pass(x) :: sync_space => l_oacc_sync_space
procedure, pass(x) :: sync_dev_space => l_oacc_sync_dev_space
procedure, pass(x) :: bld_x => l_oacc_bld_x
procedure, pass(x) :: bld_mn => l_oacc_bld_mn
procedure, pass(x) :: free => l_oacc_vect_free
@ -271,7 +271,7 @@ contains
call psb_errpush(info, 'l_oacc_bld_mn', i_err=(/n, n, n, n, n/))
end if
call x%set_host()
call x%sync_space()
call x%sync_dev_space()
end subroutine l_oacc_bld_mn
@ -293,7 +293,7 @@ contains
end if
x%v(:) = this(:)
call x%set_host()
call x%sync_space()
call x%sync_dev_space()
end subroutine l_oacc_bld_x
@ -368,11 +368,11 @@ contains
end function l_oacc_get_fmt
subroutine l_oacc_sync_space(x)
subroutine l_oacc_sync_dev_space(x)
implicit none
class(psb_l_vect_oacc), intent(inout) :: x
if (allocated(x%v)) call acc_create(x%v)
end subroutine l_oacc_sync_space
end subroutine l_oacc_sync_dev_space
subroutine l_oacc_sync(x)
implicit none
@ -446,7 +446,7 @@ contains
i_err=(/n, n, n, n, n/))
end if
call x%set_host()
call x%sync_space()
call x%sync_dev_space()
end subroutine l_oacc_vect_all
subroutine l_oacc_final_vect_free(x)

@ -36,8 +36,8 @@ module psb_s_oacc_csr_mat_mod
procedure, pass(a) :: set_host => s_oacc_csr_set_host
procedure, pass(a) :: set_sync => s_oacc_csr_set_sync
procedure, pass(a) :: set_dev => s_oacc_csr_set_dev
procedure, pass(a) :: free_space => s_oacc_csr_free_space
procedure, pass(a) :: sync_space => s_oacc_csr_sync_space
procedure, pass(a) :: free_dev_space => s_oacc_csr_free_dev_space
procedure, pass(a) :: sync_dev_space => s_oacc_csr_sync_dev_space
procedure, pass(a) :: sync => s_oacc_csr_sync
end type psb_s_oacc_csr_sparse_mat
@ -156,7 +156,7 @@ module psb_s_oacc_csr_mat_mod
contains
subroutine s_oacc_csr_free_space(a)
subroutine s_oacc_csr_free_dev_space(a)
use psb_base_mod
implicit none
class(psb_s_oacc_csr_sparse_mat), intent(inout) :: a
@ -167,7 +167,7 @@ contains
if (allocated(a%irp)) call acc_delete_finalize(a%irp)
return
end subroutine s_oacc_csr_free_space
end subroutine s_oacc_csr_free_dev_space
subroutine s_oacc_csr_free(a)
use psb_base_mod
@ -175,7 +175,7 @@ contains
class(psb_s_oacc_csr_sparse_mat), intent(inout) :: a
integer(psb_ipk_) :: info
call a%free_space()
call a%free_dev_space()
call a%psb_s_csr_sparse_mat%free()
return
@ -218,7 +218,7 @@ contains
allocate(a%ja(nz),stat=info)
allocate(a%irp(m+1),stat=info)
if (info == 0) call a%set_host()
if (info == 0) call a%sync_space()
if (info == 0) call a%sync_dev_space()
end subroutine s_oacc_csr_all
function s_oacc_csr_is_host(a) result(res)
@ -266,13 +266,13 @@ contains
a%devstate = is_dev
end subroutine s_oacc_csr_set_dev
subroutine s_oacc_csr_sync_space(a)
subroutine s_oacc_csr_sync_dev_space(a)
implicit none
class(psb_s_oacc_csr_sparse_mat), intent(inout) :: a
if (allocated(a%val)) call acc_create(a%val)
if (allocated(a%ja)) call acc_create(a%ja)
if (allocated(a%irp)) call acc_create(a%irp)
end subroutine s_oacc_csr_sync_space
end subroutine s_oacc_csr_sync_dev_space
subroutine s_oacc_csr_sync(a)
implicit none

@ -20,9 +20,9 @@ module psb_s_oacc_ell_mat_mod
procedure, pass(a) :: set_host => s_oacc_ell_set_host
procedure, pass(a) :: set_sync => s_oacc_ell_set_sync
procedure, pass(a) :: set_dev => s_oacc_ell_set_dev
procedure, pass(a) :: sync_space => s_oacc_ell_sync_space
procedure, pass(a) :: sync_dev_space => s_oacc_ell_sync_dev_space
procedure, pass(a) :: sync => s_oacc_ell_sync
procedure, pass(a) :: free_space => s_oacc_ell_free_space
procedure, pass(a) :: free_dev_space => s_oacc_ell_free_dev_space
procedure, pass(a) :: free => s_oacc_ell_free
procedure, pass(a) :: vect_mv => psb_s_oacc_ell_vect_mv
procedure, pass(a) :: in_vect_sv => psb_s_oacc_ell_inner_vect_sv
@ -154,7 +154,7 @@ module psb_s_oacc_ell_mat_mod
contains
subroutine s_oacc_ell_free_space(a)
subroutine s_oacc_ell_free_dev_space(a)
use psb_base_mod
implicit none
class(psb_s_oacc_ell_sparse_mat), intent(inout) :: a
@ -166,7 +166,7 @@ contains
if (allocated(a%idiag)) call acc_delete_finalize(a%idiag)
return
end subroutine s_oacc_ell_free_space
end subroutine s_oacc_ell_free_dev_space
subroutine s_oacc_ell_free(a)
use psb_base_mod
@ -174,7 +174,7 @@ contains
class(psb_s_oacc_ell_sparse_mat), intent(inout) :: a
integer(psb_ipk_) :: info
call a%free_space()
call a%free_dev_space()
call a%psb_s_ell_sparse_mat%free()
return
@ -195,7 +195,7 @@ contains
end function s_oacc_ell_sizeof
subroutine s_oacc_ell_sync_space(a)
subroutine s_oacc_ell_sync_dev_space(a)
implicit none
class(psb_s_oacc_ell_sparse_mat), intent(inout) :: a
@ -203,7 +203,7 @@ contains
if (allocated(a%ja)) call acc_create(a%ja)
if (allocated(a%irn)) call acc_create(a%irn)
if (allocated(a%idiag)) call acc_create(a%idiag)
end subroutine s_oacc_ell_sync_space
end subroutine s_oacc_ell_sync_dev_space
function s_oacc_ell_is_host(a) result(res)
implicit none

@ -20,9 +20,9 @@ module psb_s_oacc_hll_mat_mod
procedure, pass(a) :: set_host => s_oacc_hll_set_host
procedure, pass(a) :: set_sync => s_oacc_hll_set_sync
procedure, pass(a) :: set_dev => s_oacc_hll_set_dev
procedure, pass(a) :: sync_space => s_oacc_hll_sync_space
procedure, pass(a) :: sync_dev_space => s_oacc_hll_sync_dev_space
procedure, pass(a) :: sync => s_oacc_hll_sync
procedure, pass(a) :: free_space => s_oacc_hll_free_space
procedure, pass(a) :: free_dev_space => s_oacc_hll_free_dev_space
procedure, pass(a) :: free => s_oacc_hll_free
procedure, pass(a) :: vect_mv => psb_s_oacc_hll_vect_mv
procedure, pass(a) :: in_vect_sv => psb_s_oacc_hll_inner_vect_sv
@ -154,7 +154,7 @@ module psb_s_oacc_hll_mat_mod
contains
subroutine s_oacc_hll_free_space(a)
subroutine s_oacc_hll_free_dev_space(a)
use psb_base_mod
implicit none
class(psb_s_oacc_hll_sparse_mat), intent(inout) :: a
@ -167,7 +167,7 @@ contains
if (allocated(a%hkoffs)) call acc_delete_finalize(a%hkoffs)
return
end subroutine s_oacc_hll_free_space
end subroutine s_oacc_hll_free_dev_space
subroutine s_oacc_hll_free(a)
use psb_base_mod
@ -175,7 +175,7 @@ contains
class(psb_s_oacc_hll_sparse_mat), intent(inout) :: a
integer(psb_ipk_) :: info
call a%free_space()
call a%free_dev_space()
call a%psb_s_hll_sparse_mat%free()
return
@ -249,7 +249,7 @@ contains
res = 'HLLOA'
end function s_oacc_hll_get_fmt
subroutine s_oacc_hll_sync_space(a)
subroutine s_oacc_hll_sync_dev_space(a)
implicit none
class(psb_s_oacc_hll_sparse_mat), intent(inout) :: a
@ -258,7 +258,7 @@ contains
if (allocated(a%irn)) call acc_create(a%irn)
if (allocated(a%idiag)) call acc_create(a%idiag)
if (allocated(a%hkoffs)) call acc_create(a%hkoffs)
end subroutine s_oacc_hll_sync_space
end subroutine s_oacc_hll_sync_dev_space
subroutine s_oacc_hll_sync(a)

@ -22,7 +22,7 @@ module psb_s_oacc_vect_mod
procedure, pass(x) :: zero => s_oacc_zero
procedure, pass(x) :: asb_m => s_oacc_asb_m
procedure, pass(x) :: sync => s_oacc_sync
procedure, pass(x) :: sync_space => s_oacc_sync_space
procedure, pass(x) :: sync_dev_space => s_oacc_sync_dev_space
procedure, pass(x) :: bld_x => s_oacc_bld_x
procedure, pass(x) :: bld_mn => s_oacc_bld_mn
procedure, pass(x) :: free => s_oacc_vect_free
@ -611,7 +611,7 @@ contains
call psb_errpush(info, 's_oacc_bld_mn', i_err=(/n, n, n, n, n/))
end if
call x%set_host()
call x%sync_space()
call x%sync_dev_space()
end subroutine s_oacc_bld_mn
@ -633,7 +633,7 @@ contains
end if
x%v(:) = this(:)
call x%set_host()
call x%sync_space()
call x%sync_dev_space()
end subroutine s_oacc_bld_x
@ -762,11 +762,11 @@ contains
end function s_oacc_dot_a
subroutine s_oacc_sync_space(x)
subroutine s_oacc_sync_dev_space(x)
implicit none
class(psb_s_vect_oacc), intent(inout) :: x
if (allocated(x%v)) call acc_create(x%v)
end subroutine s_oacc_sync_space
end subroutine s_oacc_sync_dev_space
subroutine s_oacc_sync(x)
implicit none
@ -840,7 +840,7 @@ contains
i_err=(/n, n, n, n, n/))
end if
call x%set_host()
call x%sync_space()
call x%sync_dev_space()
end subroutine s_oacc_vect_all
subroutine s_oacc_final_vect_free(x)

@ -36,8 +36,8 @@ module psb_z_oacc_csr_mat_mod
procedure, pass(a) :: set_host => z_oacc_csr_set_host
procedure, pass(a) :: set_sync => z_oacc_csr_set_sync
procedure, pass(a) :: set_dev => z_oacc_csr_set_dev
procedure, pass(a) :: free_space => z_oacc_csr_free_space
procedure, pass(a) :: sync_space => z_oacc_csr_sync_space
procedure, pass(a) :: free_dev_space => z_oacc_csr_free_dev_space
procedure, pass(a) :: sync_dev_space => z_oacc_csr_sync_dev_space
procedure, pass(a) :: sync => z_oacc_csr_sync
end type psb_z_oacc_csr_sparse_mat
@ -156,7 +156,7 @@ module psb_z_oacc_csr_mat_mod
contains
subroutine z_oacc_csr_free_space(a)
subroutine z_oacc_csr_free_dev_space(a)
use psb_base_mod
implicit none
class(psb_z_oacc_csr_sparse_mat), intent(inout) :: a
@ -167,7 +167,7 @@ contains
if (allocated(a%irp)) call acc_delete_finalize(a%irp)
return
end subroutine z_oacc_csr_free_space
end subroutine z_oacc_csr_free_dev_space
subroutine z_oacc_csr_free(a)
use psb_base_mod
@ -175,7 +175,7 @@ contains
class(psb_z_oacc_csr_sparse_mat), intent(inout) :: a
integer(psb_ipk_) :: info
call a%free_space()
call a%free_dev_space()
call a%psb_z_csr_sparse_mat%free()
return
@ -218,7 +218,7 @@ contains
allocate(a%ja(nz),stat=info)
allocate(a%irp(m+1),stat=info)
if (info == 0) call a%set_host()
if (info == 0) call a%sync_space()
if (info == 0) call a%sync_dev_space()
end subroutine z_oacc_csr_all
function z_oacc_csr_is_host(a) result(res)
@ -266,13 +266,13 @@ contains
a%devstate = is_dev
end subroutine z_oacc_csr_set_dev
subroutine z_oacc_csr_sync_space(a)
subroutine z_oacc_csr_sync_dev_space(a)
implicit none
class(psb_z_oacc_csr_sparse_mat), intent(inout) :: a
if (allocated(a%val)) call acc_create(a%val)
if (allocated(a%ja)) call acc_create(a%ja)
if (allocated(a%irp)) call acc_create(a%irp)
end subroutine z_oacc_csr_sync_space
end subroutine z_oacc_csr_sync_dev_space
subroutine z_oacc_csr_sync(a)
implicit none

@ -20,9 +20,9 @@ module psb_z_oacc_ell_mat_mod
procedure, pass(a) :: set_host => z_oacc_ell_set_host
procedure, pass(a) :: set_sync => z_oacc_ell_set_sync
procedure, pass(a) :: set_dev => z_oacc_ell_set_dev
procedure, pass(a) :: sync_space => z_oacc_ell_sync_space
procedure, pass(a) :: sync_dev_space => z_oacc_ell_sync_dev_space
procedure, pass(a) :: sync => z_oacc_ell_sync
procedure, pass(a) :: free_space => z_oacc_ell_free_space
procedure, pass(a) :: free_dev_space => z_oacc_ell_free_dev_space
procedure, pass(a) :: free => z_oacc_ell_free
procedure, pass(a) :: vect_mv => psb_z_oacc_ell_vect_mv
procedure, pass(a) :: in_vect_sv => psb_z_oacc_ell_inner_vect_sv
@ -154,7 +154,7 @@ module psb_z_oacc_ell_mat_mod
contains
subroutine z_oacc_ell_free_space(a)
subroutine z_oacc_ell_free_dev_space(a)
use psb_base_mod
implicit none
class(psb_z_oacc_ell_sparse_mat), intent(inout) :: a
@ -166,7 +166,7 @@ contains
if (allocated(a%idiag)) call acc_delete_finalize(a%idiag)
return
end subroutine z_oacc_ell_free_space
end subroutine z_oacc_ell_free_dev_space
subroutine z_oacc_ell_free(a)
use psb_base_mod
@ -174,7 +174,7 @@ contains
class(psb_z_oacc_ell_sparse_mat), intent(inout) :: a
integer(psb_ipk_) :: info
call a%free_space()
call a%free_dev_space()
call a%psb_z_ell_sparse_mat%free()
return
@ -195,7 +195,7 @@ contains
end function z_oacc_ell_sizeof
subroutine z_oacc_ell_sync_space(a)
subroutine z_oacc_ell_sync_dev_space(a)
implicit none
class(psb_z_oacc_ell_sparse_mat), intent(inout) :: a
@ -203,7 +203,7 @@ contains
if (allocated(a%ja)) call acc_create(a%ja)
if (allocated(a%irn)) call acc_create(a%irn)
if (allocated(a%idiag)) call acc_create(a%idiag)
end subroutine z_oacc_ell_sync_space
end subroutine z_oacc_ell_sync_dev_space
function z_oacc_ell_is_host(a) result(res)
implicit none

@ -20,9 +20,9 @@ module psb_z_oacc_hll_mat_mod
procedure, pass(a) :: set_host => z_oacc_hll_set_host
procedure, pass(a) :: set_sync => z_oacc_hll_set_sync
procedure, pass(a) :: set_dev => z_oacc_hll_set_dev
procedure, pass(a) :: sync_space => z_oacc_hll_sync_space
procedure, pass(a) :: sync_dev_space => z_oacc_hll_sync_dev_space
procedure, pass(a) :: sync => z_oacc_hll_sync
procedure, pass(a) :: free_space => z_oacc_hll_free_space
procedure, pass(a) :: free_dev_space => z_oacc_hll_free_dev_space
procedure, pass(a) :: free => z_oacc_hll_free
procedure, pass(a) :: vect_mv => psb_z_oacc_hll_vect_mv
procedure, pass(a) :: in_vect_sv => psb_z_oacc_hll_inner_vect_sv
@ -154,7 +154,7 @@ module psb_z_oacc_hll_mat_mod
contains
subroutine z_oacc_hll_free_space(a)
subroutine z_oacc_hll_free_dev_space(a)
use psb_base_mod
implicit none
class(psb_z_oacc_hll_sparse_mat), intent(inout) :: a
@ -167,7 +167,7 @@ contains
if (allocated(a%hkoffs)) call acc_delete_finalize(a%hkoffs)
return
end subroutine z_oacc_hll_free_space
end subroutine z_oacc_hll_free_dev_space
subroutine z_oacc_hll_free(a)
use psb_base_mod
@ -175,7 +175,7 @@ contains
class(psb_z_oacc_hll_sparse_mat), intent(inout) :: a
integer(psb_ipk_) :: info
call a%free_space()
call a%free_dev_space()
call a%psb_z_hll_sparse_mat%free()
return
@ -249,7 +249,7 @@ contains
res = 'HLLOA'
end function z_oacc_hll_get_fmt
subroutine z_oacc_hll_sync_space(a)
subroutine z_oacc_hll_sync_dev_space(a)
implicit none
class(psb_z_oacc_hll_sparse_mat), intent(inout) :: a
@ -258,7 +258,7 @@ contains
if (allocated(a%irn)) call acc_create(a%irn)
if (allocated(a%idiag)) call acc_create(a%idiag)
if (allocated(a%hkoffs)) call acc_create(a%hkoffs)
end subroutine z_oacc_hll_sync_space
end subroutine z_oacc_hll_sync_dev_space
subroutine z_oacc_hll_sync(a)

@ -22,7 +22,7 @@ module psb_z_oacc_vect_mod
procedure, pass(x) :: zero => z_oacc_zero
procedure, pass(x) :: asb_m => z_oacc_asb_m
procedure, pass(x) :: sync => z_oacc_sync
procedure, pass(x) :: sync_space => z_oacc_sync_space
procedure, pass(x) :: sync_dev_space => z_oacc_sync_dev_space
procedure, pass(x) :: bld_x => z_oacc_bld_x
procedure, pass(x) :: bld_mn => z_oacc_bld_mn
procedure, pass(x) :: free => z_oacc_vect_free
@ -611,7 +611,7 @@ contains
call psb_errpush(info, 'z_oacc_bld_mn', i_err=(/n, n, n, n, n/))
end if
call x%set_host()
call x%sync_space()
call x%sync_dev_space()
end subroutine z_oacc_bld_mn
@ -633,7 +633,7 @@ contains
end if
x%v(:) = this(:)
call x%set_host()
call x%sync_space()
call x%sync_dev_space()
end subroutine z_oacc_bld_x
@ -762,11 +762,11 @@ contains
end function z_oacc_dot_a
subroutine z_oacc_sync_space(x)
subroutine z_oacc_sync_dev_space(x)
implicit none
class(psb_z_vect_oacc), intent(inout) :: x
if (allocated(x%v)) call acc_create(x%v)
end subroutine z_oacc_sync_space
end subroutine z_oacc_sync_dev_space
subroutine z_oacc_sync(x)
implicit none
@ -840,7 +840,7 @@ contains
i_err=(/n, n, n, n, n/))
end if
call x%set_host()
call x%sync_space()
call x%sync_dev_space()
end subroutine z_oacc_vect_all
subroutine z_oacc_final_vect_free(x)

Loading…
Cancel
Save