Kokkos Node API and Local Linear Algebra Kernels Version of the Day
Public Member Functions
TSQR::Test::CombineBenchmarker< Ordinal, Scalar, CombineType, TimerType > Class Template Reference

Benchmark TSQR::Combine, and also calibrate number of trials. More...

#include <Tsqr_CombineBenchmarker.hpp>

List of all members.

Public Member Functions

 CombineBenchmarker (const double timerRes, const std::vector< int > &iseed)
 Constructor with user-specified seed.
 CombineBenchmarker (const std::vector< int > &iseed)
 Constructor with user-specified 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].

Detailed Description

template<class Ordinal, class Scalar, class CombineType, class TimerType>
class TSQR::Test::CombineBenchmarker< Ordinal, Scalar, CombineType, TimerType >

Benchmark TSQR::Combine, and also calibrate number of trials.

Author:
Mark Hoemmen

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 169 of file Tsqr_CombineBenchmarker.hpp.


Constructor & Destructor Documentation

template<class Ordinal , class Scalar , class CombineType , class TimerType >
TSQR::Test::CombineBenchmarker< Ordinal, Scalar, CombineType, TimerType >::CombineBenchmarker ( const double  timerRes,
const std::vector< int > &  iseed 
) [inline]

Constructor with user-specified seed.

Parameters:
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 195 of file Tsqr_CombineBenchmarker.hpp.

template<class Ordinal , class Scalar , class CombineType , class TimerType >
TSQR::Test::CombineBenchmarker< Ordinal, Scalar, CombineType, TimerType >::CombineBenchmarker ( const std::vector< int > &  iseed) [inline]

Constructor with user-specified seed; computes timer resolution.

Parameters:
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 210 of file Tsqr_CombineBenchmarker.hpp.

template<class Ordinal , class Scalar , class CombineType , class TimerType >
TSQR::Test::CombineBenchmarker< Ordinal, Scalar, CombineType, TimerType >::CombineBenchmarker ( const double  timerRes) [inline]

Constructor with default seed.

Parameters:
timerRes[in] Resolution in seconds of the TimerType timer.

Definition at line 220 of file Tsqr_CombineBenchmarker.hpp.

template<class Ordinal , class Scalar , class CombineType , class TimerType >
TSQR::Test::CombineBenchmarker< Ordinal, Scalar, CombineType, TimerType >::CombineBenchmarker ( ) [inline]

Constructor with default seed that computes timer resolution.

Definition at line 228 of file Tsqr_CombineBenchmarker.hpp.


Member Function Documentation

template<class Ordinal , class Scalar , class CombineType , class TimerType >
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 234 of file Tsqr_CombineBenchmarker.hpp.

template<class Ordinal , class Scalar , class CombineType , class TimerType >
double TSQR::Test::CombineBenchmarker< Ordinal, Scalar, CombineType, TimerType >::timerResolution ( ) const [inline]

Smallest time interval (in seconds) which TimerType can measure.

Definition at line 241 of file Tsqr_CombineBenchmarker.hpp.

template<class Ordinal , class Scalar , class CombineType , class TimerType >
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.

Parameters:
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.
Returns:
Number of trials, and cumulative time of the benchmark over that many trials. (The second value lets you recycle that timing, so you don't have to run that benchmark again.)

Definition at line 269 of file Tsqr_CombineBenchmarker.hpp.

template<class Ordinal , class Scalar , class CombineType , class TimerType >
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.

Parameters:
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.
Returns:
Cumulative time over numTrials trials.

Definition at line 366 of file Tsqr_CombineBenchmarker.hpp.

template<class Ordinal , class Scalar , class CombineType , class TimerType >
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.

Parameters:
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.
Returns:
Number of trials, and cumulative time of the benchmark over that many trials. (The second value lets you recycle that timing, so you don't have to run that benchmark again.)

Definition at line 453 of file Tsqr_CombineBenchmarker.hpp.

template<class Ordinal , class Scalar , class CombineType , class TimerType >
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.

Parameters:
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.
Returns:
Cumulative time over numTrials trials.

Definition at line 562 of file Tsqr_CombineBenchmarker.hpp.

template<class Ordinal , class Scalar , class CombineType , class TimerType >
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.

Parameters:
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.
Returns:
Number of trials, and cumulative time of the benchmark over that many trials. (The second value lets you recycle that timing, so you don't have to run that benchmark again.)

Definition at line 656 of file Tsqr_CombineBenchmarker.hpp.

template<class Ordinal , class Scalar , class CombineType , class TimerType >
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.

Parameters:
numCols[in] Number of rows and columns in each of R1 and R2.
numTrials[in] Number of timing loops.
Returns:
Cumulative time over numTrials trials.

Definition at line 763 of file Tsqr_CombineBenchmarker.hpp.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends