Open Qmin  0.8.0
GPU-accelerated Q-tensor-based liquid crystal simulations
Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
kernelTuner Class Reference

A class that tries to dynamically optimize a kernel parameter. More...

#include <kernelTuner.h>

Public Member Functions

 kernelTuner (int start, int end, int step, int nSamples, int _period)
 Base constructor takes (start,end,step) values to scan, sample number, and period. More...
 
 ~kernelTuner ()
 destroy the cuda events More...
 
void begin ()
 
void end ()
 
int getParameter ()
 return the parameter to use for the kernel More...
 
void printTimingData ()
 print timing data to screen More...
 
bool samplingComplete ()
 Is initial sampling complete? More...
 

Protected Types

enum  State { STARTUP, IDLE, SCANNING }
 names for the internal state More...
 

Protected Member Functions

int computeOptimalParameter ()
 

Protected Attributes

int parameterValue
 
int samplesPerValue
 
int period
 
vector< int > possibleParameters
 
State internalState
 
int currentSample
 
int currentParameterIndex
 
int callsSinceLastSample
 
vector< vector< float > > sampleData
 
vector< float > sampleMedian
 
chrono::time_point< chrono::high_resolution_clock > startTime
 
chrono::time_point< chrono::high_resolution_clock > endTime
 

Detailed Description

A class that tries to dynamically optimize a kernel parameter.

Member Enumeration Documentation

◆ State

enum kernelTuner::State
protected

names for the internal state

Enumerator
STARTUP 
IDLE 
SCANNING 

Constructor & Destructor Documentation

◆ kernelTuner()

kernelTuner::kernelTuner ( int  start,
int  end,
int  step,
int  nSamples,
int  _period 
)

Base constructor takes (start,end,step) values to scan, sample number, and period.

References callsSinceLastSample, currentParameterIndex, currentSample, end(), internalState, parameterValue, period, possibleParameters, resize(), sampleData, sampleMedian, samplesPerValue, and STARTUP.

◆ ~kernelTuner()

kernelTuner::~kernelTuner ( )

destroy the cuda events

Member Function Documentation

◆ begin()

void kernelTuner::begin ( )

References IDLE, internalState, and startTime.

◆ end()

void kernelTuner::end ( )

◆ getParameter()

int kernelTuner::getParameter ( )
inline

return the parameter to use for the kernel

References parameterValue.

◆ printTimingData()

void kernelTuner::printTimingData ( )
inline

print timing data to screen

References parameterValue, possibleParameters, and sampleMedian.

◆ samplingComplete()

bool kernelTuner::samplingComplete ( )
inline

Is initial sampling complete?

References internalState, and STARTUP.

◆ computeOptimalParameter()

int kernelTuner::computeOptimalParameter ( )
protected

References possibleParameters, sampleData, sampleMedian, and scalar.

Referenced by end().

Member Data Documentation

◆ parameterValue

int kernelTuner::parameterValue
protected

◆ samplesPerValue

int kernelTuner::samplesPerValue
protected

Referenced by end(), and kernelTuner().

◆ period

int kernelTuner::period
protected

Referenced by end(), and kernelTuner().

◆ possibleParameters

vector<int> kernelTuner::possibleParameters
protected

◆ internalState

State kernelTuner::internalState
protected

◆ currentSample

int kernelTuner::currentSample
protected

Referenced by end(), and kernelTuner().

◆ currentParameterIndex

int kernelTuner::currentParameterIndex
protected

Referenced by end(), and kernelTuner().

◆ callsSinceLastSample

int kernelTuner::callsSinceLastSample
protected

Referenced by end(), and kernelTuner().

◆ sampleData

vector<vector< float> > kernelTuner::sampleData
protected

◆ sampleMedian

vector<float> kernelTuner::sampleMedian
protected

◆ startTime

chrono::time_point<chrono::high_resolution_clock> kernelTuner::startTime
protected

Referenced by begin(), and end().

◆ endTime

chrono::time_point<chrono::high_resolution_clock> kernelTuner::endTime
protected

Referenced by end().


The documentation for this class was generated from the following files: