benchmark Program

Uses

  • program~~benchmark~~UsesGraph program~benchmark benchmark fortime fortime program~benchmark->fortime kinds kinds program~benchmark->kinds module~forsvd forsvd program~benchmark->module~forsvd module~forsvd->kinds

Calls

program~~benchmark~~CallsGraph program~benchmark benchmark interface~svd forsvd::svd program~benchmark->interface~svd timer_start timer_start program~benchmark->timer_start timer_stop timer_stop program~benchmark->timer_stop proc~svd_rel forsvd::svd_rel interface~svd->proc~svd_rel proc~gesdd_rel forsvd::gesdd_rel proc~svd_rel->proc~gesdd_rel proc~gesvd_rel forsvd::gesvd_rel proc~svd_rel->proc~gesvd_rel

Variables

Type Attributes Name Initial
real(kind=rk), dimension(:, :), allocatable :: A
real(kind=rk), dimension(:, :), allocatable :: U
real(kind=rk), dimension(:, :), allocatable :: VT
real(kind=rk), dimension(:), allocatable :: S
integer :: m
integer :: n
integer :: i
integer :: ntests
type(timer) :: t

Source Code

program benchmark

   use kinds
   use forsvd, only: svd
   use fortime, only: timer

   implicit none

   real(rk), dimension(:, :), allocatable :: A, U, VT
   real(rk), dimension(:),    allocatable :: S
   integer                                :: m, n, i, ntests
   type(timer)                            :: t

   m = 1000
   n = 1000

   allocate(A(m,n), U(m,m), S(min(m,n)), VT(n,n))

   call random_number(A)
   A = A*10.0_rk


   ntests = 5

   call t%timer_start()
   do i = 1, ntests
      call svd(A, U,S,VT, 'gesvd')
   end do
   call t%timer_stop(nloops = ntests, message='Elapsed time (gesvd): ')


   call t%timer_start()
   do i = 1, ntests
      call svd(A, U,S,VT, 'gesdd')
   end do
   call t%timer_stop(nloops = ntests, message='Elapsed time (gesdd): ')


   deallocate(A, U, S, VT)

end program benchmark