ROOT  6.06/09
Reference Guide
Enumerations | Functions | Variables
stressVdt.cxx File Reference
#include <vector>
#include <iostream>
#include <cmath>
#include <assert.h>
#include <limits>
#include <iomanip>
#include <map>
#include <string>
#include "vdt/vdtMath.h"
#include "TStopwatch.h"
#include "TRandom3.h"
#include "TH1F.h"
#include "TCanvas.h"
#include "TError.h"
+ Include dependency graph for stressVdt.cxx:

Go to the source code of this file.

Enumerations

enum  rangeType {
  kReal, kExp, kExpf, kRealPlus,
  km1p1
}
 

Functions

template<class T >
uint64_t fp2uint (T)
 
template<>
uint64_t fp2uint< double > (double x)
 
template<>
uint64_t fp2uint< float > (float x)
 
template<class T >
uint32_t diffbit (const T a, const T b)
 Returns most significative different bit. More...
 
template<typename T , typename F >
void calculateValues (F mathFunc, const std::vector< T > &inputVector, std::vector< T > &outputVector)
 
template<typename T >
void compareOutputs (const std::vector< T > &inputVector1, const std::vector< T > &inputVector2, std::vector< uint32_t > &outputVector)
 
template<typename T >
void fillRandom (std::vector< T > &randomV, const rangeType theRangeType)
 
template<typename T >
void treatBinDiffHisto (TH1F &histo, const std::vector< T > &VDTVals, const std::vector< T > &SystemVals)
 
template<typename T , typename F >
double measureTiming (F mathFunc, const std::vector< T > &inputVector, std::vector< T > &outputVector)
 
template<typename T , typename F1 , typename F2 >
void compareFunctions (const std::string &label, F1 vdtFunc, F2 systemFunc, const std::vector< T > &inputVector, std::vector< T > &outputVectorVDT, std::vector< T > &outputVectorSystem, float &speedup, uint32_t &maxdiffBit, TH1F &histo)
 
void checkFunction (const std::string &label, float, uint32_t maxdiffBit)
 
float isqrtf (float x)
 
double isqrt (double x)
 
void spStep1 ()
 
void spStep2 ()
 
void spStep3 ()
 
void dpStep1 ()
 
void dpStep2 ()
 
void dpStep3 ()
 
int main ()
 

Variables

const double RANGE =3000.
 Simple program to benchmark vdt accuracy and cpu performance. More...
 
const uint32_t SIZE = 16777216
 
struct staticInitHelper gbl
 

Enumeration Type Documentation

enum rangeType
Enumerator
kReal 
kExp 
kExpf 
kRealPlus 
km1p1 

Definition at line 91 of file stressVdt.cxx.

Function Documentation

template<typename T , typename F >
void calculateValues ( F  mathFunc,
const std::vector< T > &  inputVector,
std::vector< T > &  outputVector 
)
inline

Definition at line 60 of file stressVdt.cxx.

void checkFunction ( const std::string &  label,
float  ,
uint32_t  maxdiffBit 
)

Definition at line 253 of file stressVdt.cxx.

Referenced by dpStep1(), dpStep2(), dpStep3(), spStep1(), spStep2(), and spStep3().

template<typename T , typename F1 , typename F2 >
void compareFunctions ( const std::string &  label,
F1  vdtFunc,
F2  systemFunc,
const std::vector< T > &  inputVector,
std::vector< T > &  outputVectorVDT,
std::vector< T > &  outputVectorSystem,
float &  speedup,
uint32_t &  maxdiffBit,
TH1F histo 
)
inline

Definition at line 200 of file stressVdt.cxx.

template<typename T >
void compareOutputs ( const std::vector< T > &  inputVector1,
const std::vector< T > &  inputVector2,
std::vector< uint32_t > &  outputVector 
)

Definition at line 76 of file stressVdt.cxx.

Referenced by treatBinDiffHisto().

template<class T >
uint32_t diffbit ( const T  a,
const T  b 
)
inline

Returns most significative different bit.

Definition at line 47 of file stressVdt.cxx.

Referenced by compareOutputs().

void dpStep1 ( )

Definition at line 332 of file stressVdt.cxx.

Referenced by main().

void dpStep2 ( )

Definition at line 356 of file stressVdt.cxx.

Referenced by main().

void dpStep3 ( )

Definition at line 373 of file stressVdt.cxx.

Referenced by main().

template<typename T >
void fillRandom ( std::vector< T > &  randomV,
const rangeType  theRangeType 
)

Definition at line 98 of file stressVdt.cxx.

Referenced by dpStep1(), dpStep2(), dpStep3(), spStep1(), spStep2(), and spStep3().

template<class T >
uint64_t fp2uint ( )

Definition at line 26 of file stressVdt.cxx.

template<>
uint64_t fp2uint< double > ( double  x)

Definition at line 33 of file stressVdt.cxx.

template<>
uint64_t fp2uint< float > ( float  x)

Definition at line 39 of file stressVdt.cxx.

double isqrt ( double  x)
inline

Definition at line 266 of file stressVdt.cxx.

Referenced by dpStep2().

float isqrtf ( float  x)
inline

Definition at line 265 of file stressVdt.cxx.

Referenced by spStep2().

int main ( )

Definition at line 391 of file stressVdt.cxx.

template<typename T , typename F >
double measureTiming ( F  mathFunc,
const std::vector< T > &  inputVector,
std::vector< T > &  outputVector 
)
inline

Definition at line 135 of file stressVdt.cxx.

void spStep1 ( )

Definition at line 273 of file stressVdt.cxx.

Referenced by main().

void spStep2 ( )

Definition at line 298 of file stressVdt.cxx.

Referenced by main().

void spStep3 ( )

Definition at line 315 of file stressVdt.cxx.

Referenced by main().

template<typename T >
void treatBinDiffHisto ( TH1F histo,
const std::vector< T > &  VDTVals,
const std::vector< T > &  SystemVals 
)

Definition at line 118 of file stressVdt.cxx.

Referenced by compareFunctions().

Variable Documentation

struct staticInitHelper gbl
const double RANGE =3000.

Simple program to benchmark vdt accuracy and cpu performance.

Definition at line 20 of file stressVdt.cxx.

Referenced by fillRandom().

const uint32_t SIZE = 16777216