Kernel Tuning Toolkit 2.3
 
Loading...
Searching...
No Matches
ktt::ParameterPair Class Reference

#include <ParameterPair.h>

Public Member Functions

 ParameterPair ()
 
 ParameterPair (const std::string &name, const ParameterValue &value, const bool isCompilerParameter=false)
 
void SetValue (const ParameterValue &value)
 
const std::string & GetName () const
 
std::string GetString () const
 
std::string GetValueString () const
 
const ParameterValueGetValue () const
 
uint64_t GetValueUint () const
 
ParameterValueType GetValueType () const
 
bool IsCompilerParameter () const
 
bool HasSameValue (const ParameterPair &other) const
 

Static Public Member Functions

static ParameterValueType GetTypeFromValue (const ParameterValue &value)
 
template<typename T >
static T GetParameterValue (const std::vector< ParameterPair > &pairs, const std::string &name)
 
template<typename T >
static std::vector< T > GetParameterValues (const std::vector< ParameterPair > &pairs, const std::vector< std::string > &names)
 

Detailed Description

Class which holds single value for one kernel parameter.

Constructor & Destructor Documentation

◆ ParameterPair() [1/2]

ktt::ParameterPair::ParameterPair ( )

Constructor which creates an empty parameter pair.

◆ ParameterPair() [2/2]

ktt::ParameterPair::ParameterPair ( const std::string &  name,
const ParameterValue value,
const bool  isCompilerParameter = false 
)
explicit

Constructor which creates a parameter pair with the specified value.

Parameters
nameName of a kernel parameter tied to the pair.
valueValue of a parameter.
isCompilerParameterIf true, this paramater is a compiler option rather than in the program prefix.

Member Function Documentation

◆ GetName()

const std::string & ktt::ParameterPair::GetName ( ) const

Returns name of a parameter.

Returns
Name of a parameter.

◆ GetParameterValue()

template<typename T >
template< typename T > static T ktt::ParameterPair::GetParameterValue ( const std::vector< ParameterPair > &  pairs,
const std::string &  name 
)
static

Returns value of the specified parameter from parameter pairs.

Parameters
pairsPairs which will be searched for the specified parameter.
nameParameter whose value will be returned.
Returns
Value of the specified parameter. Throws KTT exception if the specified parameter was not found.

◆ GetParameterValues()

template<typename T >
template< typename T > static std::vector< T > ktt::ParameterPair::GetParameterValues ( const std::vector< ParameterPair > &  pairs,
const std::vector< std::string > &  names 
)
static

Returns value of all the specified parameters from parameter pairs.

Parameters
pairsPairs which will be searched for the specified parameters.
namesParameters whose values will be returned.
Returns
Values of the specified parameters. Throws KTT exception if any of the specified parameters was not found.

◆ GetString()

std::string ktt::ParameterPair::GetString ( ) const

Converts parameter pair to string.

Returns
String in format "parameterName: parameterValue".

◆ GetTypeFromValue()

static ParameterValueType ktt::ParameterPair::GetTypeFromValue ( const ParameterValue value)
static

Returns type of the specified parameter value.

Returns
Type of the specified parameter value.

◆ GetValue()

const ParameterValue & ktt::ParameterPair::GetValue ( ) const

Returns parameter pair value.

Returns
Parameter pair value.

◆ GetValueString()

std::string ktt::ParameterPair::GetValueString ( ) const

Converts parameter value to string.

Returns
Parameter value converted to string.

◆ GetValueType()

ParameterValueType ktt::ParameterPair::GetValueType ( ) const

Returns type of the parameter pair value.

Returns
Type of the parameter pair value.

◆ GetValueUint()

uint64_t ktt::ParameterPair::GetValueUint ( ) const

Returns unsigned integer representation of parameter pair value.

Returns
Unsigned integer representation of parameter pair value.

◆ HasSameValue()

bool ktt::ParameterPair::HasSameValue ( const ParameterPair other) const

Checks if parameter value is same as other parameter value.

Parameters
otherSource for other value.
Returns
True if the values are same, false otherwise.

◆ IsCompilerParameter()

bool ktt::ParameterPair::IsCompilerParameter ( ) const

Returns whether this parameter is a compiler parameter

Returns
True if parameter is a compiler parameter, false otherwise.

◆ SetValue()

void ktt::ParameterPair::SetValue ( const ParameterValue value)

Setter for parameter value.

Parameters
valueNew value of a parameter.

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