Skip to content

Commit

Permalink
Update unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
gha3mi committed Feb 1, 2024
1 parent 2b0b679 commit f20949d
Show file tree
Hide file tree
Showing 4 changed files with 321 additions and 0 deletions.
84 changes: 84 additions & 0 deletions test/test1.f90
Original file line number Diff line number Diff line change
Expand Up @@ -109,5 +109,89 @@ program test_matmul3
C = matmul(A,B, option='m13', nblock=4)
call ut%check(C, C_ref, tol=1e-5_rk, msg='test_matmul3.28')



C = matmul(A,B, option='m1', transA=.false., transB=.false.)
call ut%check(C, C_ref, tol=1e-5_rk, msg='test_matmul3.29')

C = matmul(A,B, option='m2', transA=.false., transB=.false.)
call ut%check(C, C_ref, tol=1e-5_rk, msg='test_matmul3.30')

C = matmul(A,B, option='m3', transA=.false., transB=.false.)
call ut%check(C, C_ref, tol=1e-5_rk, msg='test_matmul3.31')

C = matmul(A,B, option='m4', transA=.false., transB=.false.)
call ut%check(C, C_ref, tol=1e-5_rk, msg='test_matmul3.32')

C = matmul(A,B, option='m5', transA=.false., transB=.false.)
call ut%check(C, C_ref, tol=1e-5_rk, msg='test_matmul3.33')

C = matmul(A,B, option='m6', transA=.false., transB=.false.)
call ut%check(C, C_ref, tol=1e-5_rk, msg='test_matmul3.34')

C = matmul(A,B, option='m7', transA=.false., transB=.false.)
call ut%check(C, C_ref, tol=1e-5_rk, msg='test_matmul3.35')

C = matmul(A,B, option='m8', transA=.false., transB=.false.)
call ut%check(C, C_ref, tol=1e-5_rk, msg='test_matmul3.36')

C = matmul(A,B, option='m9', transA=.false., transB=.false.)
call ut%check(C, C_ref, tol=1e-5_rk, msg='test_matmul3.37')

! C = matmul(A,B, option='m10', transA=.false., transB=.false.)
! call ut%check(C, C_ref, tol=1e-5_rk, msg='test_matmul3.38')

! C = matmul(A,B, option='m11', transA=.false., transB=.false.)
! call ut%check(C, C_ref, tol=1e-5_rk, msg='test_matmul3.39')

C = matmul(A,B, option='m12', transA=.false., transB=.false.)
call ut%check(C, C_ref, tol=1e-5_rk, msg='test_matmul3.40')

C = matmul(A,B, option='m13', transA=.false., transB=.false.)
call ut%check(C, C_ref, tol=1e-5_rk, msg='test_matmul3.41')


C = matmul(A,B, nblock=4, transA=.false., transB=.false.)
call ut%check(C, C_ref, tol=1e-5_rk, msg='test_matmul3.42')

C = matmul(A,B, option='m1', nblock=4, transA=.false., transB=.false.)
call ut%check(C, C_ref, tol=1e-5_rk, msg='test_matmul3.43')

C = matmul(A,B, option='m2', nblock=4, transA=.false., transB=.false.)
call ut%check(C, C_ref, tol=1e-5_rk, msg='test_matmul3.44')

C = matmul(A,B, option='m3', nblock=4, transA=.false., transB=.false.)
call ut%check(C, C_ref, tol=1e-5_rk, msg='test_matmul3.45')

C = matmul(A,B, option='m4', nblock=4, transA=.false., transB=.false.)
call ut%check(C, C_ref, tol=1e-5_rk, msg='test_matmul3.46')

C = matmul(A,B, option='m5', nblock=4, transA=.false., transB=.false.)
call ut%check(C, C_ref, tol=1e-5_rk, msg='test_matmul3.47')

C = matmul(A,B, option='m6', nblock=4, transA=.false., transB=.false.)
call ut%check(C, C_ref, tol=1e-5_rk, msg='test_matmul3.48')

C = matmul(A,B, option='m7', nblock=4, transA=.false., transB=.false.)
call ut%check(C, C_ref, tol=1e-5_rk, msg='test_matmul3.49')

C = matmul(A,B, option='m8', nblock=4, transA=.false., transB=.false.)
call ut%check(C, C_ref, tol=1e-5_rk, msg='test_matmul3.50')

C = matmul(A,B, option='m9', nblock=4, transA=.false., transB=.false.)
call ut%check(C, C_ref, tol=1e-5_rk, msg='test_matmul3.51')

! C = matmul(A,B, option='m10', nblock=4, transA=.false., transB=.false.)
! call ut%check(C, C_ref, tol=1e-5_rk, msg='test_matmul3.52')

! C = matmul(A,B, option='m11', nblock=4, transA=.false., transB=.false.)
! call ut%check(C, C_ref, tol=1e-5_rk, msg='test_matmul3.53')

C = matmul(A,B, option='m12', nblock=4, transA=.false., transB=.false.)
call ut%check(C, C_ref, tol=1e-5_rk, msg='test_matmul3.54')

C = matmul(A,B, option='m13', nblock=4, transA=.false., transB=.false.)
call ut%check(C, C_ref, tol=1e-5_rk, msg='test_matmul3.55')

end program test_matmul3

91 changes: 91 additions & 0 deletions test/test2.f90
Original file line number Diff line number Diff line change
Expand Up @@ -112,5 +112,96 @@ program test_matmul4
C = matmul(A,B, option='m13', transA=.true., nblock=4)
call ut%check(C, C_ref, tol=1e-5_rk, msg='test_matmul4.28')




C = matmul(A,B, transA=.true., transB=.false.)
call ut%check(C, C_ref, tol=1e-5_rk, msg='test_matmul4.29')

C = matmul(A,B, option='m1', transA=.true., transB=.false.)
call ut%check(C, C_ref, tol=1e-5_rk, msg='test_matmul4.30')

C = matmul(A,B, option='m2', transA=.true., transB=.false.)
call ut%check(C, C_ref, tol=1e-5_rk, msg='test_matmul4.31')

C = matmul(A,B, option='m3', transA=.true., transB=.false.)
call ut%check(C, C_ref, tol=1e-5_rk, msg='test_matmul4.32')

C = matmul(A,B, option='m4', transA=.true., transB=.false.)
call ut%check(C, C_ref, tol=1e-5_rk, msg='test_matmul4.33')

C = matmul(A,B, option='m5', transA=.true., transB=.false.)
call ut%check(C, C_ref, tol=1e-5_rk, msg='test_matmul4.34')

C = matmul(A,B, option='m6', transA=.true., transB=.false.)
call ut%check(C, C_ref, tol=1e-5_rk, msg='test_matmul4.35')

C = matmul(A,B, option='m7', transA=.true., transB=.false.)
call ut%check(C, C_ref, tol=1e-5_rk, msg='test_matmul4.36')

C = matmul(A,B, option='m8', transA=.true., transB=.false.)
call ut%check(C, C_ref, tol=1e-5_rk, msg='test_matmul4.37')

C = matmul(A,B, option='m9', transA=.true., transB=.false.)
call ut%check(C, C_ref, tol=1e-5_rk, msg='test_matmul4.38')

! C = matmul(A,B, option='m10', transA=.true., transB=.false.)
! call ut%check(C, C_ref, tol=1e-5_rk, msg='test_matmul4.39')

! C = matmul(A,B, option='m11', transA=.true., transB=.false.)
! call ut%check(C, C_ref, tol=1e-5_rk, msg='test_matmul4.40')

C = matmul(A,B, option='m12', transA=.true., transB=.false.)
call ut%check(C, C_ref, tol=1e-5_rk, msg='test_matmul4.41')

C = matmul(A,B, option='m13', transA=.true., transB=.false.)
call ut%check(C, C_ref, tol=1e-5_rk, msg='test_matmul4.42')





C = matmul(A,B, transA=.true., transB=.false., nblock=4)
call ut%check(C, C_ref, tol=1e-5_rk, msg='test_matmul4.43')

C = matmul(A,B, option='m1', transA=.true., transB=.false., nblock=4)
call ut%check(C, C_ref, tol=1e-5_rk, msg='test_matmul4.44')

C = matmul(A,B, option='m2', transA=.true., transB=.false., nblock=4)
call ut%check(C, C_ref, tol=1e-5_rk, msg='test_matmul4.45')

C = matmul(A,B, option='m3', transA=.true., transB=.false., nblock=4)
call ut%check(C, C_ref, tol=1e-5_rk, msg='test_matmul4.46')

C = matmul(A,B, option='m4', transA=.true., transB=.false., nblock=4)
call ut%check(C, C_ref, tol=1e-5_rk, msg='test_matmul4.47')

C = matmul(A,B, option='m5', transA=.true., transB=.false., nblock=4)
call ut%check(C, C_ref, tol=1e-5_rk, msg='test_matmul4.48')

C = matmul(A,B, option='m6', transA=.true., transB=.false., nblock=4)
call ut%check(C, C_ref, tol=1e-5_rk, msg='test_matmul4.49')

C = matmul(A,B, option='m7', transA=.true., transB=.false., nblock=4)
call ut%check(C, C_ref, tol=1e-5_rk, msg='test_matmul4.50')

C = matmul(A,B, option='m8', transA=.true., transB=.false., nblock=4)
call ut%check(C, C_ref, tol=1e-5_rk, msg='test_matmul4.51')

C = matmul(A,B, option='m9', transA=.true., transB=.false., nblock=4)
call ut%check(C, C_ref, tol=1e-5_rk, msg='test_matmul4.52')

! C = matmul(A,B, option='m10', transA=.true., transB=.false., nblock=4)
! call ut%check(C, C_ref, tol=1e-5_rk, msg='test_matmul4.53')

! C = matmul(A,B, option='m11', transA=.true., transB=.false., nblock=4)
! call ut%check(C, C_ref, tol=1e-5_rk, msg='test_matmul4.54')

C = matmul(A,B, option='m12', transA=.true., transB=.false., nblock=4)
call ut%check(C, C_ref, tol=1e-5_rk, msg='test_matmul4.55')

C = matmul(A,B, option='m13', transA=.true., transB=.false., nblock=4)
call ut%check(C, C_ref, tol=1e-5_rk, msg='test_matmul4.56')

end program test_matmul4

90 changes: 90 additions & 0 deletions test/test3.f90
Original file line number Diff line number Diff line change
Expand Up @@ -111,5 +111,95 @@ program test_matmul5
C = matmul(A,B, option='m13', transB=.true., nblock=4)
call ut%check(C, C_ref, tol=1e-5_rk, msg='test_matmul5.28')




C = matmul(A,B, transA=.false., transB=.true.)
call ut%check(C, C_ref, tol=1e-5_rk, msg='test_matmul5.29')

C = matmul(A,B, option='m1', transA=.false., transB=.true.)
call ut%check(C, C_ref, tol=1e-5_rk, msg='test_matmul5.30')

C = matmul(A,B, option='m2', transA=.false., transB=.true.)
call ut%check(C, C_ref, tol=1e-5_rk, msg='test_matmul5.31')

C = matmul(A,B, option='m3', transA=.false., transB=.true.)
call ut%check(C, C_ref, tol=1e-5_rk, msg='test_matmul5.32')

C = matmul(A,B, option='m4', transA=.false., transB=.true.)
call ut%check(C, C_ref, tol=1e-5_rk, msg='test_matmul5.33')

C = matmul(A,B, option='m5', transA=.false., transB=.true.)
call ut%check(C, C_ref, tol=1e-5_rk, msg='test_matmul5.34')

C = matmul(A,B, option='m6', transA=.false., transB=.true.)
call ut%check(C, C_ref, tol=1e-5_rk, msg='test_matmul5.35')

C = matmul(A,B, option='m7', transA=.false., transB=.true.)
call ut%check(C, C_ref, tol=1e-5_rk, msg='test_matmul5.36')

C = matmul(A,B, option='m8', transA=.false., transB=.true.)
call ut%check(C, C_ref, tol=1e-5_rk, msg='test_matmul5.37')

C = matmul(A,B, option='m9', transA=.false., transB=.true.)
call ut%check(C, C_ref, tol=1e-5_rk, msg='test_matmul5.38')

! C = matmul(A,B, option='m10', transA=.false., transB=.true.)
! call ut%check(C, C_ref, tol=1e-5_rk, msg='test_matmul5.39')

! C = matmul(A,B, option='m11', transA=.false., transB=.true.)
! call ut%check(C, C_ref, tol=1e-5_rk, msg='test_matmul5.40')

C = matmul(A,B, option='m12', transA=.false., transB=.true.)
call ut%check(C, C_ref, tol=1e-5_rk, msg='test_matmul5.41')

C = matmul(A,B, option='m13', transA=.false., transB=.true.)
call ut%check(C, C_ref, tol=1e-5_rk, msg='test_matmul5.42')




C = matmul(A,B, transA=.false., transB=.true., nblock=4)
call ut%check(C, C_ref, tol=1e-5_rk, msg='test_matmul5.43')

C = matmul(A,B, option='m1', transA=.false., transB=.true., nblock=4)
call ut%check(C, C_ref, tol=1e-5_rk, msg='test_matmul5.44')

C = matmul(A,B, option='m2', transA=.false., transB=.true., nblock=4)
call ut%check(C, C_ref, tol=1e-5_rk, msg='test_matmul5.45')

C = matmul(A,B, option='m3', transA=.false., transB=.true., nblock=4)
call ut%check(C, C_ref, tol=1e-5_rk, msg='test_matmul5.46')

C = matmul(A,B, option='m4', transA=.false., transB=.true., nblock=4)
call ut%check(C, C_ref, tol=1e-5_rk, msg='test_matmul5.47')

C = matmul(A,B, option='m5', transA=.false., transB=.true., nblock=4)
call ut%check(C, C_ref, tol=1e-5_rk, msg='test_matmul5.48')

C = matmul(A,B, option='m6', transA=.false., transB=.true., nblock=4)
call ut%check(C, C_ref, tol=1e-5_rk, msg='test_matmul5.49')

C = matmul(A,B, option='m7', transA=.false., transB=.true., nblock=4)
call ut%check(C, C_ref, tol=1e-5_rk, msg='test_matmul5.50')

C = matmul(A,B, option='m8', transA=.false., transB=.true., nblock=4)
call ut%check(C, C_ref, tol=1e-5_rk, msg='test_matmul5.51')

C = matmul(A,B, option='m9', transA=.false., transB=.true., nblock=4)
call ut%check(C, C_ref, tol=1e-5_rk, msg='test_matmul5.52')

! C = matmul(A,B, option='m10', transA=.false., transB=.true., nblock=4)
! call ut%check(C, C_ref, tol=1e-5_rk, msg='test_matmul5.53')

! C = matmul(A,B, option='m11', transA=.false., transB=.true., nblock=4)
! call ut%check(C, C_ref, tol=1e-5_rk, msg='test_matmul5.54')

C = matmul(A,B, option='m12', transA=.false., transB=.true., nblock=4)
call ut%check(C, C_ref, tol=1e-5_rk, msg='test_matmul5.55')

C = matmul(A,B, option='m13', transA=.false., transB=.true., nblock=4)
call ut%check(C, C_ref, tol=1e-5_rk, msg='test_matmul5.56')

end program test_matmul5

56 changes: 56 additions & 0 deletions test/test5.f90
Original file line number Diff line number Diff line change
Expand Up @@ -81,5 +81,61 @@ program test_matmul7
! w = matmul(A,v, option='m8', nblock=4)
! call ut%check(w, w_ref, tol=1e-5_rk, msg='test_matmul7.18')



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

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

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

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

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

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

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

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




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

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

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

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

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

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

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

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

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

end program test_matmul7

0 comments on commit f20949d

Please sign in to comment.