|
|
|
@ -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
|
|
|
|
|