Current list of heuristics:
Basic structure of a heuristic:
FUNCTION HeurType :: EvaluateHeuristic( heur:HeurType, A:matrix ) IF this heuristic does not apply to A and its trace THEN RETURN NULL; ENDIF LET results = Choose tuning parameters for A RETURN results
FUNCTION RBSpMV :: EvaluateHeuristic( heur:HeurType, A:matrix ) IF A->trace not "dominated" by calls to SpMV THEN RETURN NULL; ENDIF LET EstFill[MAX_R, MAX_C] = EstimateFill( A ) LET Mflops_dense[MAX_R, MAX_C] = LoadRegProfile( A ) LET r, c = max_{r,c} Mflops_dense[r,c] / EstFill[r, c] IF r == 1 AND c == 1 THEN RETURN NULL; ELSE LET results = new RbSpMV_results( r, c ) RETURN results ENDIF
#include <math.h>
#include <oski/common.h>
#include <oski/simplelist.h>
#include <oski/heur_internal.h>
#include <oski/heur_typedep.h>
#include <oski/heurexport.h>
#include <oski/trace.h>
#include <oski/tune.h>
#include <oski/timer.h>
#include <oski/matrix.h>
#include <oski/vecview.h>
#include <oski/xforms.h>
Defines | |
#define | BEST_FRAC_OBSERVED .25 |
Fraction of observed workload available for tuning. | |
#define | BEST_FRAC_WORKLOAD .25 |
Fraction of hint workload available for tuning. | |
Functions | |
static double | ComputeTuningBudget (oski_matrix_t A_tunable) |
Returns the estimated number of seconds available for tuning. | |
static int | ChooseFastest (oski_matrix_t A_tunable) |
Determines whether the heuristic-selected data structure leads to faster execution times than the input data structure. | |
static void | FreeTunedMat (oski_matrix_t A_tunable) |
int | oski_TuneMat (oski_matrix_t A_tunable) |
Tune the matrix object using all hints and implicit profiling data. |
|
Determines whether the heuristic-selected data structure leads to faster execution times than the input data structure.
|
|
Returns the estimated number of seconds available for tuning. The estimate is based on the larger of the following two quantities:
|