test_matmul14 Program

Uses

  • program~~test_matmul14~~UsesGraph program~test_matmul14 test_matmul14 forunittest forunittest program~test_matmul14->forunittest kinds kinds program~test_matmul14->kinds module~formatmul formatmul program~test_matmul14->module~formatmul module~formatmul->kinds module~formatmul_opts formatmul_opts module~formatmul->module~formatmul_opts module~formatmul_opts->kinds

Calls

program~~test_matmul14~~CallsGraph program~test_matmul14 test_matmul14 check check program~test_matmul14->check

Variables

Type Attributes Name Initial
real(kind=rk), allocatable :: A(:,:)
real(kind=rk), allocatable :: v(:)
real(kind=rk), allocatable :: w_ref(:)
real(kind=rk), allocatable :: w(:)
integer :: m
integer :: n
integer :: im
type(unit_test) :: ut

Source Code

program test_matmul14

   use kinds
   use formatmul
   use forunittest

   implicit none

   real(rk), allocatable :: A(:,:), v(:)
   real(rk), allocatable :: w_ref(:), w(:)
   integer               :: m, n, im
   type(unit_test)       :: ut

#if defined(USE_COARRAY)
   im = this_image()
#else
   im = 1
#endif

   ! w(m) = A(m,n).v(n)
   m = 500
   n = 300

   allocate(A(m,n),v(n))
   call random_number(A)
   call random_number(v)
   A = A*100.0_rk
   v = v*100.0_rk


   w_ref = matmul(A,v)

   w = matmul(A,v, coarray=.true.)
   if (im==1) call ut%check(w, w_ref, tol=1e-5_rk, msg='test_matmul14.1')

   w = matmul(A,v, option='m1', coarray=.true.)
   if (im==1) call ut%check(w, w_ref, tol=1e-5_rk, msg='test_matmul14.2')

   w = matmul(A,v, option='m2', coarray=.true.)
   if (im==1) call ut%check(w, w_ref, tol=1e-5_rk, msg='test_matmul14.3')

   w = matmul(A,v, option='m3', coarray=.true.)
   if (im==1) call ut%check(w, w_ref, tol=1e-5_rk, msg='test_matmul14.4')

   w = matmul(A,v, option='m4', coarray=.true.)
   if (im==1) call ut%check(w, w_ref, tol=1e-5_rk, msg='test_matmul14.5')

   w = matmul(A,v, option='m5', coarray=.true.)
   if (im==1) call ut%check(w, w_ref, tol=1e-5_rk, msg='test_matmul14.6')

   w = matmul(A,v, option='m6', coarray=.true.)
   if (im==1) call ut%check(w, w_ref, tol=1e-5_rk, msg='test_matmul14.7')

   ! w = matmul(A,v, option='m7', coarray=.true.)
   ! if (im==1) call ut%check(w, w_ref, tol=1e-5_rk, msg='test_matmul14.8')

   ! w = matmul(A,v, option='m8', coarray=.true.)
   ! if (im==1) call ut%check(w, w_ref, tol=1e-5_rk, msg='test_matmul14.9')

end program test_matmul14