Introduce submodules, adjust Makefile

oacc_loloum
sfilippone 3 months ago
parent 0707cc0a72
commit 7006665d82

@ -2,6 +2,7 @@ include ../../Make.inc
LIBDIR=../../lib
INCDIR=../../include
MODDIR=../../modules
UP=..
#
# Compilers and such
#
@ -22,6 +23,17 @@ objs: $(OBJS)
lib: objs
ar cur ../$(LIBNAME) $(OBJS)
psb_d_oacc_csr_vect_mv.o psb_d_oacc_csr_inner_vect_sv.o \
psb_d_oacc_csr_csmm.o psb_d_oacc_csr_csmv.o psb_d_oacc_csr_scals.o \
psb_d_oacc_csr_scal.o psb_d_oacc_csr_allocate_mnnz.o \
psb_d_oacc_csr_reallocate_nz.o psb_d_oacc_csr_cp_from_coo.o \
psb_d_oacc_csr_cp_from_fmt.o psb_d_oacc_csr_mv_from_coo.o \
psb_d_oacc_csr_mv_from_fmt.o psb_d_oacc_csr_mold.o: $(UP)/psb_d_oacc_csr_mat_mod.o
psb_d_oacc_mlt_v_2.o psb_d_oacc_mlt_v.o: $(UP)/psb_d_oacc_vect_mod.o
clean:
/bin/rm -f $(OBJS)

@ -1,6 +1,7 @@
subroutine psb_d_oacc_csr_allocate_mnnz(m, n, a, nz)
submodule (psb_d_oacc_csr_mat_mod) psb_d_oacc_csr_allocate_mnnz_impl
use psb_base_mod
use psb_d_oacc_csr_mat_mod, psb_protect_name => psb_d_oacc_csr_allocate_mnnz
contains
module subroutine psb_d_oacc_csr_allocate_mnnz(m, n, a, nz)
implicit none
integer(psb_ipk_), intent(in) :: m, n
class(psb_d_oacc_csr_sparse_mat), intent(inout) :: a
@ -31,4 +32,4 @@ subroutine psb_d_oacc_csr_allocate_mnnz(m, n, a, nz)
return
end subroutine psb_d_oacc_csr_allocate_mnnz
end submodule psb_d_oacc_csr_allocate_mnnz_impl

@ -1,6 +1,7 @@
subroutine psb_d_oacc_csr_cp_from_coo(a, b, info)
submodule (psb_d_oacc_csr_mat_mod) psb_d_oacc_csr_cp_from_coo_impl
use psb_base_mod
use psb_d_oacc_csr_mat_mod, psb_protect_name => psb_d_oacc_csr_cp_from_coo
contains
module subroutine psb_d_oacc_csr_cp_from_coo(a, b, info)
implicit none
class(psb_d_oacc_csr_sparse_mat), intent(inout) :: a
@ -22,4 +23,4 @@ subroutine psb_d_oacc_csr_cp_from_coo(a, b, info)
return
end subroutine psb_d_oacc_csr_cp_from_coo
end submodule psb_d_oacc_csr_cp_from_coo_impl

@ -1,6 +1,7 @@
subroutine psb_d_oacc_csr_cp_from_fmt(a, b, info)
submodule (psb_d_oacc_csr_mat_mod) psb_d_oacc_csr_cp_from_fmt_impl
use psb_base_mod
use psb_d_oacc_csr_mat_mod, psb_protect_name => psb_d_oacc_csr_cp_from_fmt
contains
module subroutine psb_d_oacc_csr_cp_from_fmt(a, b, info)
implicit none
class(psb_d_oacc_csr_sparse_mat), intent(inout) :: a
@ -20,4 +21,4 @@ subroutine psb_d_oacc_csr_cp_from_fmt(a, b, info)
end select
end subroutine psb_d_oacc_csr_cp_from_fmt
end submodule psb_d_oacc_csr_cp_from_fmt_impl

@ -1,8 +1,7 @@
subroutine psb_d_oacc_csr_csmm(alpha, a, x, beta, y, info, trans)
submodule (psb_d_oacc_csr_mat_mod) psb_d_oacc_csr_csmm_impl
use psb_base_mod
!use elldev_mod
!use psb_vectordev_mod
use psb_d_oacc_csr_mat_mod, psb_protect_name => psb_d_oacc_csr_csmm
contains
module subroutine psb_d_oacc_csr_csmm(alpha, a, x, beta, y, info, trans)
implicit none
class(psb_d_oacc_csr_sparse_mat), intent(in) :: a
real(psb_dpk_), intent(in) :: alpha, beta
@ -83,4 +82,5 @@ subroutine psb_d_oacc_csr_csmm(alpha, a, x, beta, y, info, trans)
return
end subroutine psb_d_oacc_csr_csmm
end submodule psb_d_oacc_csr_csmm_impl

@ -1,8 +1,7 @@
subroutine psb_d_oacc_csr_csmv(alpha, a, x, beta, y, info, trans)
submodule (psb_d_oacc_csr_mat_mod) psb_d_oacc_csr_csmv_impl
use psb_base_mod
!use elldev_mod
!use psb_vectordev_mod
use psb_d_oacc_csr_mat_mod, psb_protect_name => psb_d_oacc_csr_csmv
contains
module subroutine psb_d_oacc_csr_csmv(alpha, a, x, beta, y, info, trans)
implicit none
class(psb_d_oacc_csr_sparse_mat), intent(in) :: a
real(psb_dpk_), intent(in) :: alpha, beta
@ -78,4 +77,5 @@ subroutine psb_d_oacc_csr_csmv(alpha, a, x, beta, y, info, trans)
return
end subroutine psb_d_oacc_csr_csmv
end submodule psb_d_oacc_csr_csmv_impl

@ -1,9 +1,7 @@
subroutine psb_d_oacc_csr_inner_vect_sv(alpha, a, x, beta, y, info, trans)
submodule (psb_d_oacc_csr_mat_mod) psb_d_oacc_csr_inner_vect_sv_impl
use psb_base_mod
! use elldev_mod
! use psb_vectordev_mod
use psb_d_oacc_csr_mat_mod, psb_protect_name => psb_d_oacc_csr_inner_vect_sv
use psb_d_oacc_vect_mod
contains
module subroutine psb_d_oacc_csr_inner_vect_sv(alpha, a, x, beta, y, info, trans)
implicit none
class(psb_d_oacc_csr_sparse_mat), intent(in) :: a
real(psb_dpk_), intent(in) :: alpha, beta
@ -81,4 +79,5 @@ subroutine psb_d_oacc_csr_inner_vect_sv(alpha, a, x, beta, y, info, trans)
9999 call psb_error_handler(err_act)
return
end subroutine psb_d_oacc_csr_inner_vect_sv
end submodule psb_d_oacc_csr_inner_vect_sv_impl

@ -1,6 +1,7 @@
subroutine psb_d_oacc_csr_mold(a, b, info)
submodule (psb_d_oacc_csr_mat_mod) psb_d_oacc_csr_mold_impl
use psb_base_mod
use psb_d_oacc_csr_mat_mod, psb_protect_name => psb_d_oacc_csr_mold
contains
module subroutine psb_d_oacc_csr_mold(a, b, info)
implicit none
class(psb_d_oacc_csr_sparse_mat), intent(in) :: a
class(psb_d_base_sparse_mat), intent(inout), allocatable :: b
@ -30,4 +31,5 @@ subroutine psb_d_oacc_csr_mold(a, b, info)
return
end subroutine psb_d_oacc_csr_mold
end submodule psb_d_oacc_csr_mold_impl

@ -1,6 +1,7 @@
subroutine psb_d_oacc_csr_mv_from_coo(a, b, info)
submodule (psb_d_oacc_csr_mat_mod) psb_d_oacc_csr_mv_from_coo_impl
use psb_base_mod
use psb_d_oacc_csr_mat_mod, psb_protect_name => psb_d_oacc_csr_mv_from_coo
contains
module subroutine psb_d_oacc_csr_mv_from_coo(a, b, info)
implicit none
class(psb_d_oacc_csr_sparse_mat), intent(inout) :: a
@ -21,4 +22,4 @@ subroutine psb_d_oacc_csr_mv_from_coo(a, b, info)
return
end subroutine psb_d_oacc_csr_mv_from_coo
end submodule psb_d_oacc_csr_mv_from_coo_impl

@ -1,6 +1,7 @@
subroutine psb_d_oacc_csr_mv_from_fmt(a, b, info)
submodule (psb_d_oacc_csr_mat_mod) psb_d_oacc_csr_mv_from_fmt_impl
use psb_base_mod
use psb_d_oacc_csr_mat_mod, psb_protect_name => psb_d_oacc_csr_mv_from_fmt
contains
module subroutine psb_d_oacc_csr_mv_from_fmt(a, b, info)
implicit none
class(psb_d_oacc_csr_sparse_mat), intent(inout) :: a
@ -20,4 +21,4 @@ subroutine psb_d_oacc_csr_mv_from_fmt(a, b, info)
end select
end subroutine psb_d_oacc_csr_mv_from_fmt
end submodule psb_d_oacc_csr_mv_from_fmt_impl

@ -1,6 +1,7 @@
subroutine psb_d_oacc_csr_reallocate_nz(nz, a)
submodule (psb_d_oacc_csr_mat_mod) psb_d_oacc_csr_reallocate_nz_impl
use psb_base_mod
use psb_d_oacc_csr_mat_mod, psb_protect_name => psb_d_oacc_csr_reallocate_nz
contains
module subroutine psb_d_oacc_csr_reallocate_nz(nz, a)
implicit none
integer(psb_ipk_), intent(in) :: nz
class(psb_d_oacc_csr_sparse_mat), intent(inout) :: a
@ -24,4 +25,4 @@ subroutine psb_d_oacc_csr_reallocate_nz(nz, a)
return
end subroutine psb_d_oacc_csr_reallocate_nz
end submodule psb_d_oacc_csr_reallocate_nz_impl

@ -1,6 +1,7 @@
subroutine psb_d_oacc_csr_scal(d, a, info, side)
submodule (psb_d_oacc_csr_mat_mod) psb_d_oacc_csr_scal_impl
use psb_base_mod
use psb_d_oacc_csr_mat_mod, psb_protect_name => psb_d_oacc_csr_scal
contains
module subroutine psb_d_oacc_csr_scal(d, a, info, side)
implicit none
class(psb_d_oacc_csr_sparse_mat), intent(inout) :: a
real(psb_dpk_), intent(in) :: d(:)
@ -49,4 +50,4 @@ subroutine psb_d_oacc_csr_scal(d, a, info, side)
return
end subroutine psb_d_oacc_csr_scal
end submodule psb_d_oacc_csr_scal_impl

@ -1,6 +1,7 @@
subroutine psb_d_oacc_csr_scals(d, a, info)
submodule (psb_d_oacc_csr_mat_mod) psb_d_oacc_csr_scals_impl
use psb_base_mod
use psb_d_oacc_csr_mat_mod, psb_protect_name => psb_d_oacc_csr_scals
contains
module subroutine psb_d_oacc_csr_scals(d, a, info)
implicit none
class(psb_d_oacc_csr_sparse_mat), intent(inout) :: a
real(psb_dpk_), intent(in) :: d
@ -30,3 +31,4 @@ subroutine psb_d_oacc_csr_scals(d, a, info)
return
end subroutine psb_d_oacc_csr_scals
end submodule psb_d_oacc_csr_scals_impl

@ -1,6 +1,7 @@
subroutine psb_d_oacc_csr_vect_mv(alpha, a, x, beta, y, info, trans)
submodule (psb_d_oacc_csr_mat_mod) psb_d_oacc_csr_vect_mv_impl
use psb_base_mod
use psb_d_oacc_csr_mat_mod, psb_protect_name => psb_d_oacc_csr_vect_mv
contains
module subroutine psb_d_oacc_csr_vect_mv(alpha, a, x, beta, y, info, trans)
implicit none
real(psb_dpk_), intent(in) :: alpha, beta
@ -59,3 +60,4 @@ contains
end subroutine inner_spmv
end subroutine psb_d_oacc_csr_vect_mv
end submodule psb_d_oacc_csr_vect_mv_impl

@ -1,6 +1,8 @@
submodule (psb_d_oacc_vect_mod) psb_d_oacc_mlt_v_impl
use psb_string_mod
contains
subroutine d_oacc_mlt_v(x, y, info)
use psb_d_oacc_vect_mod, psb_protect_name => d_oacc_mlt_v
module subroutine psb_d_oacc_mlt_v(x, y, info)
implicit none
class(psb_d_base_vect_type), intent(inout) :: x
@ -28,4 +30,5 @@ subroutine d_oacc_mlt_v(x, y, info)
end do
call y%set_host()
end select
end subroutine d_oacc_mlt_v
end subroutine psb_d_oacc_mlt_v
end submodule psb_d_oacc_mlt_v_impl

@ -1,6 +1,7 @@
subroutine d_oacc_mlt_v_2(alpha, x, y, beta, z, info, conjgx, conjgy)
use psb_d_oacc_vect_mod, psb_protect_name => d_oacc_mlt_v_2
submodule (psb_d_oacc_vect_mod) d_oacc_mlt_v_2_impl
use psb_string_mod
contains
module subroutine d_oacc_mlt_v_2(alpha, x, y, beta, z, info, conjgx, conjgy)
implicit none
real(psb_dpk_), intent(in) :: alpha, beta
class(psb_d_base_vect_type), intent(inout) :: x
@ -50,4 +51,5 @@ subroutine d_oacc_mlt_v_2(alpha, x, y, beta, z, info, conjgx, conjgy)
call z%set_host()
end select
end subroutine d_oacc_mlt_v_2
end submodule d_oacc_mlt_v_2_impl

@ -40,8 +40,7 @@ module psb_d_oacc_csr_mat_mod
end type psb_d_oacc_csr_sparse_mat
interface
subroutine psb_d_oacc_csr_mold(a,b,info)
import :: psb_d_oacc_csr_sparse_mat, psb_d_base_sparse_mat, psb_ipk_
module subroutine psb_d_oacc_csr_mold(a,b,info)
class(psb_d_oacc_csr_sparse_mat), intent(in) :: a
class(psb_d_base_sparse_mat), intent(inout), allocatable :: b
integer(psb_ipk_), intent(out) :: info
@ -49,8 +48,7 @@ module psb_d_oacc_csr_mat_mod
end interface
interface
subroutine psb_d_oacc_csr_cp_from_fmt(a,b,info)
import :: psb_d_oacc_csr_sparse_mat, psb_d_base_sparse_mat, psb_ipk_
module subroutine psb_d_oacc_csr_cp_from_fmt(a,b,info)
class(psb_d_oacc_csr_sparse_mat), intent(inout) :: a
class(psb_d_base_sparse_mat), intent(in) :: b
integer(psb_ipk_), intent(out) :: info
@ -58,8 +56,7 @@ module psb_d_oacc_csr_mat_mod
end interface
interface
subroutine psb_d_oacc_csr_mv_from_coo(a,b,info)
import :: psb_d_oacc_csr_sparse_mat, psb_d_coo_sparse_mat, psb_ipk_
module subroutine psb_d_oacc_csr_mv_from_coo(a,b,info)
class(psb_d_oacc_csr_sparse_mat), intent(inout) :: a
class(psb_d_coo_sparse_mat), intent(inout) :: b
integer(psb_ipk_), intent(out) :: info
@ -67,8 +64,7 @@ module psb_d_oacc_csr_mat_mod
end interface
interface
subroutine psb_d_oacc_csr_mv_from_fmt(a,b,info)
import :: psb_d_oacc_csr_sparse_mat, psb_d_base_sparse_mat, psb_ipk_
module subroutine psb_d_oacc_csr_mv_from_fmt(a,b,info)
class(psb_d_oacc_csr_sparse_mat), intent(inout) :: a
class(psb_d_base_sparse_mat), intent(inout) :: b
integer(psb_ipk_), intent(out) :: info
@ -76,8 +72,7 @@ module psb_d_oacc_csr_mat_mod
end interface
interface
subroutine psb_d_oacc_csr_vect_mv(alpha, a, x, beta, y, info, trans)
import :: psb_d_oacc_csr_sparse_mat, psb_dpk_, psb_d_base_vect_type, psb_ipk_
module subroutine psb_d_oacc_csr_vect_mv(alpha, a, x, beta, y, info, trans)
class(psb_d_oacc_csr_sparse_mat), intent(in) :: a
real(psb_dpk_), intent(in) :: alpha, beta
class(psb_d_base_vect_type), intent(inout) :: x, y
@ -87,8 +82,7 @@ module psb_d_oacc_csr_mat_mod
end interface
interface
subroutine psb_d_oacc_csr_inner_vect_sv(alpha, a, x, beta, y, info, trans)
import :: psb_d_oacc_csr_sparse_mat, psb_dpk_, psb_d_base_vect_type, psb_ipk_
module subroutine psb_d_oacc_csr_inner_vect_sv(alpha, a, x, beta, y, info, trans)
class(psb_d_oacc_csr_sparse_mat), intent(in) :: a
real(psb_dpk_), intent(in) :: alpha, beta
class(psb_d_base_vect_type), intent(inout) :: x,y
@ -98,8 +92,7 @@ module psb_d_oacc_csr_mat_mod
end interface
interface
subroutine psb_d_oacc_csr_csmm(alpha, a, x, beta, y, info, trans)
import :: psb_d_oacc_csr_sparse_mat, psb_dpk_, psb_d_base_vect_type, psb_ipk_
module subroutine psb_d_oacc_csr_csmm(alpha, a, x, beta, y, info, trans)
class(psb_d_oacc_csr_sparse_mat), intent(in) :: a
real(psb_dpk_), intent(in) :: alpha, beta, x(:,:)
real(psb_dpk_), intent(inout) :: y(:,:)
@ -109,8 +102,7 @@ module psb_d_oacc_csr_mat_mod
end interface
interface
subroutine psb_d_oacc_csr_csmv(alpha, a, x, beta, y, info, trans)
import :: psb_d_oacc_csr_sparse_mat, psb_dpk_, psb_d_base_vect_type, psb_ipk_
module subroutine psb_d_oacc_csr_csmv(alpha, a, x, beta, y, info, trans)
class(psb_d_oacc_csr_sparse_mat), intent(in) :: a
real(psb_dpk_), intent(in) :: alpha, beta, x(:)
real(psb_dpk_), intent(inout) :: y(:)
@ -120,8 +112,7 @@ module psb_d_oacc_csr_mat_mod
end interface
interface
subroutine psb_d_oacc_csr_scals(d, a, info)
import :: psb_d_oacc_csr_sparse_mat, psb_dpk_, psb_ipk_
module subroutine psb_d_oacc_csr_scals(d, a, info)
class(psb_d_oacc_csr_sparse_mat), intent(inout) :: a
real(psb_dpk_), intent(in) :: d
integer(psb_ipk_), intent(out) :: info
@ -129,8 +120,7 @@ module psb_d_oacc_csr_mat_mod
end interface
interface
subroutine psb_d_oacc_csr_scal(d,a,info,side)
import :: psb_d_oacc_csr_sparse_mat, psb_dpk_, psb_ipk_
module subroutine psb_d_oacc_csr_scal(d,a,info,side)
class(psb_d_oacc_csr_sparse_mat), intent(inout) :: a
real(psb_dpk_), intent(in) :: d(:)
integer(psb_ipk_), intent(out) :: info
@ -139,16 +129,14 @@ module psb_d_oacc_csr_mat_mod
end interface
interface
subroutine psb_d_oacc_csr_reallocate_nz(nz,a)
import :: psb_d_oacc_csr_sparse_mat, psb_ipk_
module subroutine psb_d_oacc_csr_reallocate_nz(nz,a)
class(psb_d_oacc_csr_sparse_mat), intent(inout) :: a
integer(psb_ipk_), intent(in) :: nz
end subroutine psb_d_oacc_csr_reallocate_nz
end interface
interface
subroutine psb_d_oacc_csr_allocate_mnnz(m,n,a,nz)
import :: psb_d_oacc_csr_sparse_mat, psb_ipk_
module subroutine psb_d_oacc_csr_allocate_mnnz(m,n,a,nz)
class(psb_d_oacc_csr_sparse_mat), intent(inout) :: a
integer(psb_ipk_), intent(in) :: m,n
integer(psb_ipk_), intent(in), optional :: nz
@ -156,8 +144,7 @@ module psb_d_oacc_csr_mat_mod
end interface
interface
subroutine psb_d_oacc_csr_cp_from_coo(a,b,info)
import :: psb_d_oacc_csr_sparse_mat, psb_d_coo_sparse_mat, psb_ipk_
module subroutine psb_d_oacc_csr_cp_from_coo(a,b,info)
class(psb_d_oacc_csr_sparse_mat), intent(inout) :: a
class(psb_d_coo_sparse_mat), intent(in) :: b
integer(psb_ipk_), intent(out) :: info

@ -49,8 +49,8 @@ module psb_d_oacc_vect_mod
procedure, pass(z) :: abgdxyz => d_oacc_abgdxyz
procedure, pass(y) :: mlt_a => d_oacc_mlt_a
procedure, pass(z) :: mlt_a_2 => d_oacc_mlt_a_2
procedure, pass(y) :: mlt_v => d_oacc_mlt_v
procedure, pass(z) :: mlt_v_2 => d_oacc_mlt_v_2
procedure, pass(y) :: mlt_v => psb_d_oacc_mlt_v
procedure, pass(z) :: mlt_v_2 => psb_d_oacc_mlt_v_2
procedure, pass(x) :: scal => d_oacc_scal
procedure, pass(x) :: nrm2 => d_oacc_nrm2
procedure, pass(x) :: amax => d_oacc_amax
@ -63,19 +63,17 @@ module psb_d_oacc_vect_mod
real(psb_dpk_), allocatable :: v1(:),v2(:),p(:)
interface
subroutine d_oacc_mlt_v(x, y, info)
import
module subroutine psb_d_oacc_mlt_v(x, y, info)
implicit none
class(psb_d_base_vect_type), intent(inout) :: x
class(psb_d_vect_oacc), intent(inout) :: y
integer(psb_ipk_), intent(out) :: info
end subroutine d_oacc_mlt_v
end subroutine psb_d_oacc_mlt_v
end interface
interface
subroutine d_oacc_mlt_v_2(alpha, x, y, beta, z, info, conjgx, conjgy)
import
module subroutine psb_d_oacc_mlt_v_2(alpha, x, y, beta, z, info, conjgx, conjgy)
implicit none
real(psb_dpk_), intent(in) :: alpha, beta
class(psb_d_base_vect_type), intent(inout) :: x
@ -83,7 +81,7 @@ module psb_d_oacc_vect_mod
class(psb_d_vect_oacc), intent(inout) :: z
integer(psb_ipk_), intent(out) :: info
character(len=1), intent(in), optional :: conjgx, conjgy
end subroutine d_oacc_mlt_v_2
end subroutine psb_d_oacc_mlt_v_2
end interface
contains

Loading…
Cancel
Save