added using new spmm implementation

sp3mm-interface
wlthr 2 years ago
parent 867ca0c1d0
commit 9b6542d350

@ -3367,7 +3367,7 @@ subroutine psb_dcsrspspmm(a,b,c,info, spmm_impl_id)
end if
! CSR matrix multiplication
call csr_spspmm(a,b,c,spmm_impl_id_,info)
call csr_spspmm(a,b,c,info,spmm_impl_id_)
call c%set_asb()
call c%set_host()
@ -3381,13 +3381,13 @@ subroutine psb_dcsrspspmm(a,b,c,info, spmm_impl_id)
contains
subroutine csr_spspmm(a,b,c,spmm_impl_id,info)
subroutine csr_spspmm(a,b,c,info,spmm_impl_id)
implicit none
type(psb_d_csr_sparse_mat), intent(in) :: a,b
type(psb_d_csr_sparse_mat), intent(inout) :: c
! choice of spmm implementation from c code
integer(psb_ipk_), intent(in) :: spmm_impl_id
integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_), intent(in) :: spmm_impl_id
integer(psb_ipk_) :: ma,na,mb,nb
integer(psb_ipk_), allocatable :: irow(:), idxs(:)
real(psb_dpk_), allocatable :: row(:)
@ -3401,29 +3401,7 @@ contains
mb = b%get_nrows()
nb = b%get_ncols()
!! TODO :
! * convert psb_d_csr_sparse_mat a and b to spmat_t
! * choice of implementation
! * code interfaces for sp3mm code
! * call wanted interface
! * convert result from spmat_t to psb_d_csr_sparse_mat c
! conversion
! select case (spmm_impl_id)
! case (SPMM_ROW_BY_ROW_UB)
! ! call spmm_row_by_row_ub
! case (SPMM_ROW_BY_ROW_SYMB_NUM)
! ! call spmm_row_by_row_symb_num
! case (SPMM_ROW_BY_ROW_1D_BLOCKS_SYMB_NUM)
! ! call spmm_row_by_row_1d_blocks_symb_num
! case (SPMM_ROW_BY_ROW_2D_BLOCKS_SYMB_NUM)
! ! call spmm_row_by_row_2d_blocks_symb_num
! case default
! ! call default choice
! end select
if (.false.) then
nze = min(size(c%val),size(c%ja))
isz = max(ma,na,mb,nb)
call psb_realloc(isz,row,info)
@ -3470,7 +3448,15 @@ contains
end do
c%irp(ma+1) = nzc
else
!! TODO :
! * convert psb_d_csr_sparse_mat a and b to spmat_t
! * choice of implementation
! * code interfaces for sp3mm code
! * call wanted interface
! * convert result from spmat_t to psb_d_csr_sparse_mat c
call dspmm(a,b,c,info,spmm_impl_id_)
end if
end subroutine csr_spspmm

@ -12,7 +12,7 @@ subroutine dspmm(a,b,c,info, impl_choice)
type(psb_d_csr_sparse_mat), intent(in) :: a,b
type(psb_d_csr_sparse_mat), intent(inout):: c
integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_), intent(in), optional :: impl_choice
integer(psb_ipk_), intent(in) :: impl_choice
! Internal variables
integer(c_size_t):: a_m,a_n,a_nz
@ -97,12 +97,6 @@ subroutine dspmm(a,b,c,info, impl_choice)
b_irp = b%irp
b_irp_ptr = c_loc(b_irp)
if (present(impl_choice)) then
impl_choice_ = impl_choice
else
impl_choice_ = 0
end if
! call calculateSize
call psb_f_spmm_build_spacc(a_m,a_n,a_nz,a_as_ptr,&
a_ja_ptr,a_irp_ptr,a_max_row_nz,&

Loading…
Cancel
Save