|
BeBOP Optimized Sparse Kernel Interface Library
1.0.1h
|
Heuristic management module. More...
Go to the source code of this file.
Defines | |
| #define | INC_OSKI_HEUR_H |
| oski/heur.h included. | |
| #define | OSKI_HEUR_METHOD(type, name) |
| Retrieve the method for a particular heuristic. | |
| #define | OSKI_HEURID_METHOD(type_id, name) |
| Retrieve the method for a particular heuristic type given the heuristic type id. | |
Functions | |
| void | oski_InitHeurManager (void) |
| Open/initialize the heuristic manager. | |
| void | oski_CloseHeurManager (void) |
| Shutdown heuristic manager. | |
| oski_id_t | oski_RegisterHeur (const char *name, oski_id_t id_ind, oski_id_t id_val) |
| Register a new heuristic with the heuristic manager. | |
| size_t | oski_GetNumHeur (void) |
| Returns the number of available heuristics. | |
| const char * | oski_LookupHeurDescById (oski_id_t id) |
| Returns a short descriptive string for the specified heuristic. | |
| oski_id_t | oski_LookupHeurId (const char *name, oski_id_t id_ind, oski_id_t id_val) |
| Returns the id number of a specified heuristic. | |
| oski_id_t | oski_LookupHeurIdByNum (size_t i) |
| Returns the id number of the i-th heuristic. | |
| void * | oski_LookupHeurIdMethod (oski_id_t id, const char *method_name) |
| Return a method stored in a heuristic module, found by heuristic id. | |
| void * | oski_LookupHeurMethod (const char *heur_name, oski_id_t id_ind, oski_id_t id_val, const char *method_name) |
| Return a method stored in a heuristic module, found by heuristic type. | |
| FILE * | oski_OpenBenchmarkData (const char *filename) |
| Opens a file containing off-line benchmarking data for reading. | |
| void | oski_CloseBenchmarkData (FILE *fp) |
| Close an open file containing off-line benchmark data. | |
| int | oski_ReadBenchmarkLine (FILE *fp, char *buffer, size_t max_len) |
| Reads the first non-comment line in the given benchmark data file. | |
Heuristic management module.
| #define INC_OSKI_HEUR_H |
oski/heur.h included.
| #define OSKI_HEUR_METHOD | ( | type, | |
| name | |||
| ) |
(OSKI_MAKENAME_FUNCPT(name))oski_LookupHeurMethod( \ type, OSKI_IND_ID, OSKI_VAL_ID, \ "oski_" MACRO_TO_STRING(name) \ )
Retrieve the method for a particular heuristic.
Relies on the compile-time default scalar type macros, OSKI_IND_ID and OSKI_VAL_ID.
| [in] | type | Heuristic type name, as a string. |
| [in] | name | Method base name (not as a string constant). |
| #define OSKI_HEURID_METHOD | ( | type_id, | |
| name | |||
| ) |
(OSKI_MAKENAME_FUNCPT(name))oski_LookupHeurIdMethod( \ type_id, "oski_" MACRO_TO_STRING(name) \ )
Retrieve the method for a particular heuristic type given the heuristic type id.
| [in] | type_id | Heuristic type, by ID. |
| [in] | name | Method base name (not as a string constant). |
Referenced by oski_ApplyHeurResults(), oski_EstimateHeurCost(), oski_EvaluateHeur(), and oski_IsHeurApplicable().
| void oski_CloseHeurManager | ( | void | ) |
Shutdown heuristic manager.
References oski_CloseHeurManager(), oski_PrintDebugMessage(), simplelist_Destroy(), simplelist_GetElem(), and simplelist_GetLength().
Referenced by oski_Close(), and oski_CloseHeurManager().
| size_t oski_GetNumHeur | ( | void | ) |
Returns the number of available heuristics.
References oski_GetNumHeur(), and simplelist_GetLength().
Referenced by oski_FindHeurRecord(), oski_GetNumHeur(), oski_LookupHeur(), and oski_TuneMat().
| void oski_InitHeurManager | ( | void | ) |
Open/initialize the heuristic manager.
References oski_InitHeurManager(), oski_PrintDebugMessage(), and simplelist_Create().
Referenced by oski_Init(), and oski_InitHeurManager().
| const char* oski_LookupHeurDescById | ( | oski_id_t | id | ) |
Returns a short descriptive string for the specified heuristic.
References oski_heurrec_t::desc, oski_FindHeurRecord(), and oski_LookupHeurDescById().
Referenced by oski_ApplyHeurResults(), oski_LookupHeurDescById(), and oski_TuneMat().
| oski_id_t oski_LookupHeurId | ( | const char * | name, |
| oski_id_t | id_ind, | ||
| oski_id_t | id_val | ||
| ) |
Returns the id number of a specified heuristic.
References oski_heurrec_t::id, INVALID_ID, oski_LookupHeur(), and oski_LookupHeurId().
Referenced by oski_LookupHeurId(), oski_LookupHeurMethod(), and oski_RegisterHeur().
| oski_id_t oski_LookupHeurIdByNum | ( | size_t | i | ) |
Returns the id number of the i-th heuristic.
References oski_heurrec_t::id, INVALID_ID, oski_LookupHeurIdByNum(), and simplelist_GetElem().
Referenced by oski_LookupHeurIdByNum(), and oski_TuneMat().
| void* oski_LookupHeurIdMethod | ( | oski_id_t | id, |
| const char * | method_name | ||
| ) |
Return a method stored in a heuristic module, found by heuristic id.
References oski_heurrec_t::module, oski_FindHeurRecord(), oski_LookupHeurIdMethod(), and oski_LookupModuleMethod().
Referenced by oski_LookupHeurIdMethod(), and oski_LookupHeurMethod().
| void* oski_LookupHeurMethod | ( | const char * | heur_name, |
| oski_id_t | id_ind, | ||
| oski_id_t | id_val, | ||
| const char * | method_name | ||
| ) |
Return a method stored in a heuristic module, found by heuristic type.
References INVALID_ID, oski_LookupHeurId(), oski_LookupHeurIdMethod(), oski_LookupHeurMethod(), and oski_RegisterHeur().
Referenced by oski_LookupHeurMethod().
| FILE* oski_OpenBenchmarkData | ( | const char * | filename | ) |
Opens a file containing off-line benchmarking data for reading.
| [in] | filename | Name of the benchmark data file. This name should only contain a relative path. |
If an environment variable named 'OSKI_BENCH_DIR' is defined, then this routine searches for 'filename' in that path first, before checking the default directory, OSKI_BENCH_DIR_DEFAULT (compile-time macro).
References oski_OpenBenchmarkData().
Referenced by oski_OpenBenchmarkData().
| int oski_ReadBenchmarkLine | ( | FILE * | fp, |
| char * | buffer, | ||
| size_t | max_len | ||
| ) |
Reads the first non-comment line in the given benchmark data file.
| [in] | fp | Pointer to a benchmark data file. |
| [in,out] | buffer | Buffer in which to store the next line. |
| [in] | max_len | Maximum length of 'buffer'. |
References oski_ReadBenchmarkLine().
Referenced by oski_ReadBenchmarkLine().
| oski_id_t oski_RegisterHeur | ( | const char * | name, |
| oski_id_t | id_ind, | ||
| oski_id_t | id_val | ||
| ) |
Register a new heuristic with the heuristic manager.
References oski_heurrec_t::desc, oski_heurrec_t::id, oski_heurrec_t::id_index_type, oski_heurrec_t::id_value_type, INVALID_ID, oski_heurrec_t::modname, oski_heurrec_t::module, oski_heurrec_t::name, oski_DuplicateString(), oski_LoadModuleOptional(), oski_LookupHeurId(), oski_MakeModuleDesc(), oski_MakeModuleName(), oski_Malloc, oski_PrintDebugMessage(), oski_RegisterHeur(), and simplelist_Append().
Referenced by oski_LookupHeurMethod(), and oski_RegisterHeur().
1.7.6.1