boonnano 1
C++ library giving usage access to the Boon Logic Nano technology
 
Loading...
Searching...
No Matches
autotune.h
Go to the documentation of this file.
1
2#pragma once
3
4#include <string.h>
5#include <list>
6#include "boonconfig.h"
7#include "nanoutil.h"
8
10 public:
11 CElbowPoint() {
12 m_PV = 0.0;
13 m_ClusterCount = 0;
14 }
15 float m_PV;
16 uint16_t m_ClusterCount;
17};
18
20
24 public:
26
30 void Reset();
31
43 bool Serialize(const char* VarPath, const char* ThisVarName, struct archive* Archive, bool IsLoading);
44
53 std::string GetStatusString(int CurrentIndent = 0, int AdditionalIndent = 4);
54
61 void ConfigureDefault(uint16_t PatternLength, uint16_t MaxClusters);
62
66 std::vector<bool> m_FeaturesToTuneArray;
67 uint16_t m_MaxClusters;
68};
69
71
72#define AUTOTUNE_FATAL_ERROR 1
73#define AUTOTUNE_REBUFFER_DATA 2
74#define AUTOTUNE_INCREASE_STREAMING_WINDOW_SIZE 3
75
76class CBoonNano;
77
82
86 public:
92 CAutotuneNanoConfig(CBoonNano* Nano = nullptr);
94
101 bool Autotune(uint8_t* PatternBuffer, uint64_t PatternBufferLengthInBytes);
102
111 void GetAutotuningElbow(std::vector<float>& PVArray, std::vector<uint16_t>& ClusterCountArray);
112
117
127 bool LoadPatternBuffer(uint8_t* PatternBuffer, uint64_t NumBytes);
128
138
148
160 bool GoNextAutotuneStage(int& ResultCode, uint8_t* PatternBuffer = nullptr, uint64_t PatternBufferLengthInBytes = 0);
161
169
177
185
192
202
210
215
227 bool Serialize(const char* VarPath, const char* ThisVarName, struct archive* Archive, bool IsLoading);
228
232 void Reset();
233
238
239 private:
240 bool AutotuneRange(int& ResultCode, uint8_t* PatternBuffer = nullptr, uint64_t PatternBufferLengthInBytes = 0);
241 bool AutofillFeaturesToTuneArray(int& ResultCode);
242 bool GenerateAutotuningBuffer(int& ResultCode, uint8_t* PatternBuffer = nullptr, uint64_t PatternBufferLengthInBytes = 0);
243 void FillFromMidpoint(int StartPos, int MaxClusters);
244 bool ComputeOptimalPV(int& ResultCode);
245 void GeneratePVSearchOrder(int StartIndex, int EndIndex);
246
247 void SetErrorMessage(const char* fmt, ...);
248
249 uint8_t* m_PatternBuffer;
250 uint64_t m_PatternBufferLengthInBytes;
251 uint8_t* m_AutotuningBuffer;
252 uint64_t m_AutotuningBufferLengthInBytes;
253 uint64_t m_NumPatternsToAutotune;
254 std::list<uint16_t> m_PVSearchOrder;
255
256 CBoonNano* m_Nano;
257 bool m_ManageNanoMemory;
258
261 bool m_AutotuningInProgress;
262 bool m_AutotuningSucceeded;
263
264 double m_PercentComplete;
265
266 std::vector<CElbowPoint> m_AutotuningElbow;
267
268 char m_ErrorStringBuffer[AUTOTUNE_ERROR_MESSAGE_BUFFER_LENGTH];
269};
const int AUTOTUNE_ERROR_MESSAGE_BUFFER_LENGTH
Maximum string length of autotuning error messages.
Definition autotune.h:70
bool Serialize(const char *VarPath, const char *ThisVarName, struct archive *Archive, bool IsLoading)
bool Autotune(uint8_t *PatternBuffer, uint64_t PatternBufferLengthInBytes)
Main autotune function.
CNanoConfigParameters & GetNanoConfig()
Get autotuned nano config.
void ClearBuffers()
Clear object buffers.
char * GetErrorMessage()
Get error string.
double GetAutotuningPercentComplete() const
Get percent complete.
bool LoadAutotuningConfig(CAutotuningParameters &AP)
Setup autotuning config.
bool GoNextAutotuneStage(int &ResultCode, uint8_t *PatternBuffer=nullptr, uint64_t PatternBufferLengthInBytes=0)
Increment autotuning stage.
bool LoadNanoConfig(CNanoConfigParameters &NCP)
Setup config for autotuning.
CAutotuningParameters & GetAutotuningParameters()
Get autotuning parameters object.
bool AutotuningWasSuccessful() const
Determining if autotuning was successful.
CAutotuneNanoConfig(CBoonNano *Nano=nullptr)
Initialize with nano object.
void GetAutotuningElbow(std::vector< float > &PVArray, std::vector< uint16_t > &ClusterCountArray)
Cluster count autotuning curve.
bool AutotuningInProgress()
Determine if autotuning is running.
void Reset()
Clear object values and buffers.
bool GetAutotunedNanoConfig(CNanoConfigParameters &NCP)
Get autotuned nano config.
void DisplayAutotuningElbow()
Generates print string of autotuning elbow.
bool LoadPatternBuffer(uint8_t *PatternBuffer, uint64_t NumBytes)
Setup pattern buffer for autotuning.
Main autotuning functionality.
Definition autotune.h:85
bool Serialize(const char *VarPath, const char *ThisVarName, struct archive *Archive, bool IsLoading)
Condense object into binary file.
void ConfigureDefault(uint16_t PatternLength, uint16_t MaxClusters)
Auto-set object variables to all be true.
std::string GetStatusString(int CurrentIndent=0, int AdditionalIndent=4)
Generate print string of object.
void Reset()
Clears autotuning parameter values.
Object for autotuning specific parameters.
Definition autotune.h:23
uint16_t m_MaxClusters
only allow this many clusters for each PV that is tested
Definition autotune.h:67
std::vector< bool > m_FeaturesToTuneArray
array of booleans indicating which features are included (true) and which are excluded (false) during...
Definition autotune.h:66
bool m_AutotuneRange
true means tune the range of the features, false uses the range that has been configured
Definition autotune.h:64
bool m_AutotuneByFeature
true means each feature has its range tuned separately, false uses a min and max found over all the f...
Definition autotune.h:65
bool m_AutotunePV
true means tune the percent variation, false uses the percent variation that its been set to
Definition autotune.h:63
Main class of processing data.
Definition boonnano.h:110
Definition autotune.h:9
Main object for configuration.
Definition boonconfig.h:86