#include <Searcher.h>
Public Member Functions | |
| virtual | ~Searcher ()=default |
| virtual void | OnInitialize () |
| virtual void | OnReset () |
| virtual bool | CalculateNextConfiguration (const KernelResult &previousResult)=0 |
| virtual KernelConfiguration | GetCurrentConfiguration () const =0 |
| Searcher () | |
| KernelConfiguration | GetConfiguration (const uint64_t index) const |
| uint64_t | GetIndex (const KernelConfiguration &configuration) const |
| KernelConfiguration | GetRandomConfiguration () const |
| std::vector< KernelConfiguration > | GetNeighbourConfigurations (const KernelConfiguration &configuration, const uint64_t maxDifferences, const size_t maxNeighbours=3) const |
| uint64_t | GetConfigurationsCount () const |
| uint64_t | GetUnexploredConfigurationsCount () const |
| const std::set< uint64_t > & | GetExploredIndices () const |
| bool | IsInitialized () const |
| void | Initialize (const ConfigurationData &data) |
| void | Reset () |
Class which is used to decide which kernel configuration will be run next during the kernel tuning process.
|
virtualdefault |
Searcher destructor. Inheriting class can override destructor with custom implementation. Default implementation is provided by KTT framework.
| ktt::Searcher::Searcher | ( | ) |
Default searcher constructor. Should be called from inheriting searcher's constructor.
|
pure virtual |
Calculates the configuration which will be run next. Called after processing the current configuration if there are any remaining unexplored configurations.
| previousResult | Result from the last tested configuration. See KernelResult for more information. |
Implemented in ktt::DeterministicSearcher, ktt::McmcSearcher, and ktt::RandomSearcher.
| KernelConfiguration ktt::Searcher::GetConfiguration | ( | const uint64_t | index | ) | const |
Returns configuration with the specified index.
| index | Index of the configuration that should be retrieved. The index must be less than the count returned by GetConfigurationsCount method. |
| uint64_t ktt::Searcher::GetConfigurationsCount | ( | ) | const |
Returns total number of valid kernel configurations.
|
pure virtual |
Returns current kernel configuration. Note that this may be called repeatedly before calculating next configuration. In that case, the returned configuration must always be the same.
Implemented in ktt::DeterministicSearcher, ktt::McmcSearcher, and ktt::RandomSearcher.
| const std::set< uint64_t > & ktt::Searcher::GetExploredIndices | ( | ) | const |
Returns indices of already explored configurations.
| uint64_t ktt::Searcher::GetIndex | ( | const KernelConfiguration & | configuration | ) | const |
Returns index of the specified configuration.
| configuration | Configuration for which the index will be retrieved. |
| std::vector< KernelConfiguration > ktt::Searcher::GetNeighbourConfigurations | ( | const KernelConfiguration & | configuration, |
| const uint64_t | maxDifferences, | ||
| const size_t | maxNeighbours = 3 |
||
| ) | const |
Retrieves unexplored neighbour configurations of the specified configuration.
| configuration | Configuration whose neighbours will be retrieved. |
| maxDifferences | Maximum number of parameters in neighbour configurations whose values differ from the original configuration. |
| maxNeighbours | Maximum number of retrieved neighbour configurations. |
| KernelConfiguration ktt::Searcher::GetRandomConfiguration | ( | ) | const |
Returns random unexplored configuration.
| uint64_t ktt::Searcher::GetUnexploredConfigurationsCount | ( | ) | const |
Return number of unexplored kernel configurations
| void ktt::Searcher::Initialize | ( | const ConfigurationData & | data | ) |
Initializes searcher with the tree of configurations which can be explored for corresponding kernel.
| data | Internal structure containing configurations which can be explored |
| bool ktt::Searcher::IsInitialized | ( | ) | const |
Returns whether searcher is initialized.
|
virtual |
Called after searcher is initialized with kernel configurations. The first kernel configuration as well as custom searcher parameters should be initialized here.
Reimplemented in ktt::McmcSearcher, and ktt::RandomSearcher.
|
virtual |
Called before searcher is reset to initial state and configurations are removed. Custom searcher parameters should be reset here.
Reimplemented in ktt::DeterministicSearcher, and ktt::McmcSearcher.
| void ktt::Searcher::Reset | ( | ) |
Resets searcher to initial state and clears configuration tree.