Kokkos Node API and Local Linear Algebra Kernels Version of the Day

Benchmark TSQR::Combine, and also calibrate number of trials. More...
#include <Tsqr_CombineBenchmarker.hpp>
Public Member Functions  
CombineBenchmarker (const double timerRes, const std::vector< int > &iseed)  
Constructor with userspecified seed.  
CombineBenchmarker (const std::vector< int > &iseed)  
Constructor with userspecified seed; computes timer resolution.  
CombineBenchmarker (const double timerRes)  
Constructor with default seed.  
CombineBenchmarker ()  
Constructor with default seed that computes timer resolution.  
void  getSeed (std::vector< int > &iseed) const 
Get the current pseudorandom number generator seed.  
double  timerResolution () const 
Smallest time interval (in seconds) which TimerType can measure.  
std::pair< int, double >  calibrateFirst (const Ordinal numRows, const Ordinal numCols, const double accuracyFactor) 
Estimate number of trials for TSQR::Combine on first cache block.  
double  benchmarkFirst (const Ordinal numRows, const Ordinal numCols, const int numTrials) 
Benchmark TSQR::Combine on first cache block.  
std::pair< int, double >  calibrateCacheBlock (const Ordinal numRows, const Ordinal numCols, const double accuracyFactor) 
Estimate number of trials for TSQR::Combine on [R; A];.  
double  benchmarkCacheBlock (const Ordinal numRows, const Ordinal numCols, const int numTrials) 
Benchmark TSQR::Combine on [R; A];.  
std::pair< int, double >  calibratePair (const Ordinal numCols, const double accuracyFactor) 
Estimate number of trials for TSQR::Combine on [R1; R2].  
double  benchmarkPair (const Ordinal numCols, const int numTrials) 
Benchmark TSQR::Combine on [R1; R2]. 
Benchmark TSQR::Combine, and also calibrate number of trials.
This class both calibrates the number of trials for benchmarking the given Combine implementation for a given problem size, and does the actual benchmarking given a number of trials.
Calibration works as follows: 1. For the given timer type, approximate the timer's resolution. 2. For a given set of matrix dimensions, determine how many times the Combine benchmarks need to be run in order to get the desired accuracy of the timing results.
Template parameters:
TimerType must pass the test given by TSQR::Test::verifyTimerConcept<TimerType>()
.
Definition at line 182 of file Tsqr_CombineBenchmarker.hpp.
TSQR::Test::CombineBenchmarker< Ordinal, Scalar, CombineType, TimerType >::CombineBenchmarker  (  const double  timerRes, 
const std::vector< int > &  iseed  
)  [inline] 
Constructor with userspecified seed.
timerRes  [in] Resolution in seconds of the TimerType timer. 
iseed  [in] Seed for the pseudorandom number generator. See the LAPACK documentation (for the _LARNV routines) for requirements on the seed values. 
Definition at line 208 of file Tsqr_CombineBenchmarker.hpp.
TSQR::Test::CombineBenchmarker< Ordinal, Scalar, CombineType, TimerType >::CombineBenchmarker  (  const std::vector< int > &  iseed  )  [inline] 
Constructor with userspecified seed; computes timer resolution.
iseed  [in] Seed for the pseudorandom number generator. See the LAPACK documentation (for the _LARNV routines) for requirements on the seed values. 
Definition at line 223 of file Tsqr_CombineBenchmarker.hpp.
TSQR::Test::CombineBenchmarker< Ordinal, Scalar, CombineType, TimerType >::CombineBenchmarker  (  const double  timerRes  )  [inline] 
Constructor with default seed.
timerRes  [in] Resolution in seconds of the TimerType timer. 
Definition at line 233 of file Tsqr_CombineBenchmarker.hpp.
TSQR::Test::CombineBenchmarker< Ordinal, Scalar, CombineType, TimerType >::CombineBenchmarker  (  )  [inline] 
Constructor with default seed that computes timer resolution.
Definition at line 241 of file Tsqr_CombineBenchmarker.hpp.
void TSQR::Test::CombineBenchmarker< Ordinal, Scalar, CombineType, TimerType >::getSeed  (  std::vector< int > &  iseed  )  const [inline] 
Get the current pseudorandom number generator seed.
Definition at line 247 of file Tsqr_CombineBenchmarker.hpp.
double TSQR::Test::CombineBenchmarker< Ordinal, Scalar, CombineType, TimerType >::timerResolution  (  )  const [inline] 
Smallest time interval (in seconds) which TimerType can measure.
Definition at line 254 of file Tsqr_CombineBenchmarker.hpp.
std::pair<int, double> TSQR::Test::CombineBenchmarker< Ordinal, Scalar, CombineType, TimerType >::calibrateFirst  (  const Ordinal  numRows, 
const Ordinal  numCols,  
const double  accuracyFactor  
)  [inline] 
Estimate number of trials for TSQR::Combine on first cache block.
TSQR::Combine implementations use factor_first() to factor the "first" numRows by numCols cache block A. They then compute the explicit Q factor of the cache block A by calling apply_first() on a numRows by numCols matrix Q consisting of the first numCols columns of the identity matrix. This benchmark measures the time taken by repeatedly invoking factor_first() and then apply_first() in this way. It returns the number of trials for such invocations which takes at least as much time as the given accuracy factor, times the timer resolution.
numRows  [in] Number of rows in the cache block A. 
numCols  [in] Number of columns in the cache block A. 
accuracyFactor  [in] The computed number of trials takes at least as much time as this accuracy factor times the timer resolution. 
Definition at line 282 of file Tsqr_CombineBenchmarker.hpp.
double TSQR::Test::CombineBenchmarker< Ordinal, Scalar, CombineType, TimerType >::benchmarkFirst  (  const Ordinal  numRows, 
const Ordinal  numCols,  
const int  numTrials  
)  [inline] 
Benchmark TSQR::Combine on first cache block.
TSQR::Combine implementations use factor_first() to factor the "first" numRows by numCols cache block A. They then compute the explicit Q factor of the cache block A by calling apply_first() on a numRows by numCols matrix Q consisting of the first numCols columns of the identity matrix. This benchmark measures the time taken by repeatedly invoking factor_first() and then apply_first() in this way, for numTrials trials.
numRows  [in] Number of rows in the cache block A. 
numCols  [in] Number of columns in the cache block A. 
numTrials  [in] Number of timing loops. 
Definition at line 379 of file Tsqr_CombineBenchmarker.hpp.
std::pair<int, double> TSQR::Test::CombineBenchmarker< Ordinal, Scalar, CombineType, TimerType >::calibrateCacheBlock  (  const Ordinal  numRows, 
const Ordinal  numCols,  
const double  accuracyFactor  
)  [inline] 
Estimate number of trials for TSQR::Combine on [R; A];.
TSQR::Combine implementations use factor_inner() to factor a vertical stack [R; A] of a square R factor and a numRows by numCols cache block A. They then compute the explicit Q factor of [R; A] by calling apply_inner() on a ((numRows + numCols) by numCols) matrix Q consisting of the first numCols columns of the identity matrix. This benchmark measures the time taken by repeatedly invoking factor_inner() and then apply_inner() in this way. It returns the number of trials for such invocations which takes at least as much time as the given accuracy factor, times the timer resolution.
numRows  [in] Number of rows in the cache block A. 
numCols  [in] Number of columns in the cache block A, and number of rows and columns in R. 
accuracyFactor  [in] The computed number of trials takes at least as much time as this accuracy factor times the timer resolution. 
Definition at line 466 of file Tsqr_CombineBenchmarker.hpp.
double TSQR::Test::CombineBenchmarker< Ordinal, Scalar, CombineType, TimerType >::benchmarkCacheBlock  (  const Ordinal  numRows, 
const Ordinal  numCols,  
const int  numTrials  
)  [inline] 
Benchmark TSQR::Combine on [R; A];.
TSQR::Combine implementations use factor_inner() to factor a vertical stack [R; A] of a square R factor and a numRows by numCols cache block A. They then compute the explicit Q factor of [R; A] by calling apply_inner() on a ((numRows + numCols) by numCols) matrix Q consisting of the first numCols columns of the identity matrix. This benchmark measures the time taken by repeatedly invoking factor_inner() and then apply_inner() in this way, for numTrials trials.
numRows  [in] Number of rows in the cache block A. 
numCols  [in] Number of columns in the cache block A, and number of rows and columns in R. 
numTrials  [in] Number of timing loops. 
Definition at line 575 of file Tsqr_CombineBenchmarker.hpp.
std::pair<int, double> TSQR::Test::CombineBenchmarker< Ordinal, Scalar, CombineType, TimerType >::calibratePair  (  const Ordinal  numCols, 
const double  accuracyFactor  
)  [inline] 
Estimate number of trials for TSQR::Combine on [R1; R2].
TSQR::Combine implementations use factor_pair() to factor a stack of two square R factors [R1; R2]. They then compute the explicit Q factor of [R1; R2] by calling apply_pair() on a (2*numCols by numCols) matrix Q consisting of the first numCols columns of the 2*numCols by 2*numCols identity matrix. This benchmark measures the time taken by repeatedly invoking factor_pair() and then apply_pair() in this way. It returns the number of trials for such invocations which takes at least as much time as the given accuracy factor, times the timer resolution.
numCols  [in] Number of rows and columns in each of R1 and R2. 
accuracyFactor  [in] The computed number of trials takes at least as much time as this accuracy factor times the timer resolution. 
Definition at line 669 of file Tsqr_CombineBenchmarker.hpp.
double TSQR::Test::CombineBenchmarker< Ordinal, Scalar, CombineType, TimerType >::benchmarkPair  (  const Ordinal  numCols, 
const int  numTrials  
)  [inline] 
Benchmark TSQR::Combine on [R1; R2].
TSQR::Combine implementations use factor_pair() to factor a stack of two square R factors [R1; R2]. They then compute the explicit Q factor of [R1; R2] by calling apply_pair() on a (2*numCols by numCols) matrix Q consisting of the first numCols columns of the 2*numCols by 2*numCols identity matrix. This benchmark measures the time taken by repeatedly invoking factor_pair() and then apply_pair() in this way, for numTrials trials.
numCols  [in] Number of rows and columns in each of R1 and R2. 
numTrials  [in] Number of timing loops. 
Definition at line 776 of file Tsqr_CombineBenchmarker.hpp.