test_matmul8 Program

Uses

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

Calls

program~~test_matmul8~~CallsGraph program~test_matmul8 test_matmul8 check check program~test_matmul8->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
type(unit_test) :: ut

Source Code

program test_matmul8

   use kinds
   use formatmul
   use forunittest

   implicit none

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

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

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


   w_ref = matmul(transpose(A),v)

   w = matmul(A,v, transA=.true.)
   call ut%check(w, w_ref, tol=1e-5_rk, msg='test_matmul8.1')

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

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

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

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

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

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

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

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




   w = matmul(A,v, transA=.true., nblock=4)
   call ut%check(w, w_ref, tol=1e-5_rk, msg='test_matmul8.10')

   w = matmul(A,v, option='m1', transA=.true., nblock=4)
   call ut%check(w, w_ref, tol=1e-5_rk, msg='test_matmul8.11')

   w = matmul(A,v, option='m2', transA=.true., nblock=4)
   call ut%check(w, w_ref, tol=1e-5_rk, msg='test_matmul8.12')

   w = matmul(A,v, option='m3', transA=.true., nblock=4)
   call ut%check(w, w_ref, tol=1e-5_rk, msg='test_matmul8.13')

   w = matmul(A,v, option='m4', transA=.true., nblock=4)
   call ut%check(w, w_ref, tol=1e-5_rk, msg='test_matmul8.14')

   w = matmul(A,v, option='m5', transA=.true., nblock=4)
   call ut%check(w, w_ref, tol=1e-5_rk, msg='test_matmul8.15')

   w = matmul(A,v, option='m6', transA=.true., nblock=4)
   call ut%check(w, w_ref, tol=1e-5_rk, msg='test_matmul8.16')

   ! w = matmul(A,v, option='m7', transA=.true., nblock=4)
   ! call ut%check(w, w_ref, tol=1e-5_rk, msg='test_matmul8.17')

   ! w = matmul(A,v, option='m8', transA=.true., nblock=4)
   ! call ut%check(w, w_ref, tol=1e-5_rk, msg='test_matmul8.18')

end program test_matmul8