mageec  0.1.0
MAchine Guided Energy Efficient Compilation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
Public Member Functions | List of all members
mageec::mageec_ml Class Reference

MAGEEC Machine Learner. More...

#include <mageec-ml.h>

Inheritance diagram for mageec::mageec_ml:
mageec::file_ml

Public Member Functions

virtual ~mageec_ml ()
 
virtual int init (std::string dbfilename)
 Initilizes the MAGEEC Machine Learner. More...
 
virtual int init (std::string compiler_version, std::string compiler_target)
 Initilizes the MAGEEC Machine Learner. More...
 
void new_file (void)
 Prepares Machine Learner for a new file. More...
 
void end_file (void)
 Declares to Machine Learner processing has finished. More...
 
void finish (void)
 Hook for Machine Learner to e.g. More...
 
void provide_features (std::vector< mageec_feature * > features)
 Provide a set of program features to the machine learner to base decisions on. More...
 
std::vector< mageec_passget_passes ()
 Returns a set of passes the machine learner has chosen the compiler to execute. More...
 
std::vector< mageec_pass * > all_passes ()
 Returns complete list of passes known to machine learner for disabling upon initialisation. More...
 
virtual decision make_decision (mageec_pass *pass, std::vector< mageec_feature * > features)
 Make a single function/pass decision based on provided feature vector. More...
 
void process_results ()
 Informs the machine learner that it can process all new data to update internal decisions. More...
 
void add_result (std::vector< mageec_feature * > features, std::vector< mageec_pass * > passes, int64_t metric, bool good)
 Adds a result to the machine learner database. More...
 
void add_result (result res)
 Adds a result to the machine learner database. More...
 
void raw_result (std::vector< mageec_feature * > features, std::vector< mageec_pass * > passes, std::vector< int64_t > metrics, bool good)
 Adds a set of result points to machine learner raw database. More...
 

Detailed Description

MAGEEC Machine Learner.

Definition at line 37 of file mageec-ml.h.

Constructor & Destructor Documentation

virtual mageec::mageec_ml::~mageec_ml ( )
inlinevirtual

Definition at line 42 of file mageec-ml.h.

Member Function Documentation

void mageec::mageec_ml::add_result ( std::vector< mageec_feature * >  features,
std::vector< mageec_pass * >  passes,
int64_t  metric,
bool  good 
)

Adds a result to the machine learner database.

(Depending on the algorithm used, this may be for training purposes only)

Parameters
featuresList of features for program.
passesList of passes executed during compilation.
metricPerformance metric for optimisation.
goodWhether the result of compilation was valid (for machine learners that understand bad combinations.)
void mageec_ml::add_result ( result  res)

Adds a result to the machine learner database.

Parameters
resResult structure containing program, pass and metric info

Definition at line 89 of file ml.cpp.

std::vector< mageec_pass * > mageec_ml::all_passes ( void  )

Returns complete list of passes known to machine learner for disabling upon initialisation.

Returns
list of all passes.

Definition at line 67 of file ml.cpp.

void mageec_ml::end_file ( void  )

Declares to Machine Learner processing has finished.

Definition at line 55 of file ml.cpp.

void mageec_ml::finish ( void  )

Hook for Machine Learner to e.g.

disconnect for any resources.

Definition at line 60 of file ml.cpp.

std::vector<mageec_pass> mageec::mageec_ml::get_passes ( )

Returns a set of passes the machine learner has chosen the compiler to execute.

Returns
list of passes to execute.
int mageec_ml::init ( std::string  dbfilename)
virtual

Initilizes the MAGEEC Machine Learner.

Parameters
dbfilenamePath of database file to open.
Returns
0 if MAGEEC successfully set up, 1 otherwise.

Reimplemented in mageec::file_ml.

Definition at line 34 of file ml.cpp.

int mageec_ml::init ( std::string  compiler_version,
std::string  compiler_target 
)
virtual

Initilizes the MAGEEC Machine Learner.

Parameters
compiler_versionCompiler and version, e.g. GCC-4.8.
compiler_targetCompiler target, e.g. arm-none-gnueabi.
Returns
0 if MAGEEC successfully set up, 1 otherwise.

Reimplemented in mageec::file_ml.

Definition at line 44 of file ml.cpp.

decision mageec_ml::make_decision ( mageec_pass pass,
std::vector< mageec_feature * >  features 
)
virtual

Make a single function/pass decision based on provided feature vector.

Parameters
passPass to make a decision about.
featuresFeature vector of function to run pass on.
Returns
decision

Reimplemented in mageec::file_ml.

Definition at line 96 of file ml.cpp.

void mageec_ml::new_file ( void  )

Prepares Machine Learner for a new file.

Definition at line 50 of file ml.cpp.

void mageec_ml::process_results ( )

Informs the machine learner that it can process all new data to update internal decisions.

Definition at line 155 of file ml.cpp.

void mageec::mageec_ml::provide_features ( std::vector< mageec_feature * >  features)

Provide a set of program features to the machine learner to base decisions on.

Parameters
featuresList of features for program.
void mageec::mageec_ml::raw_result ( std::vector< mageec_feature * >  features,
std::vector< mageec_pass * >  passes,
std::vector< int64_t >  metrics,
bool  good 
)

Adds a set of result points to machine learner raw database.

Parameters
featuresList of features for program.
passesList of passes executed during compilation.
metricsPerformance metrics.
goodWhether the result of compilation was valid (for machine learners that understand bad combinations.)

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