summaryrefslogtreecommitdiff
path: root/src/tuning/kernels/xgemm.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/tuning/kernels/xgemm.cpp')
-rw-r--r--src/tuning/kernels/xgemm.cpp55
1 files changed, 7 insertions, 48 deletions
diff --git a/src/tuning/kernels/xgemm.cpp b/src/tuning/kernels/xgemm.cpp
index 98d3b68b..063a3bae 100644
--- a/src/tuning/kernels/xgemm.cpp
+++ b/src/tuning/kernels/xgemm.cpp
@@ -30,7 +30,7 @@ class TuneXgemm {
// The representative kernel and the source code
// static std::string KernelFamily() { return (V==1) ? "xgemm_1" : "xgemm_2"; }
- static std::string KernelFamily() { switch(V){ case 1: return "xgemm_1"; case 2: case 3:return "xgemm_2"; }}
+ static std::string KernelFamily() { switch(V){ case 1: return "xgemm_1"; case 2: return "xgemm_2"; }}
static std::string KernelName() { return "Xgemm"; }
static std::string GetSources() {
return
@@ -44,7 +44,7 @@ class TuneXgemm {
// The list of arguments relevant for this routine
static std::vector<std::string> GetOptions() {
return {kArgM, kArgN, kArgK, kArgAlpha, kArgBeta, kArgFraction,
- kArgHeuristicSelection, kArgMultiSearchStrategy, kArgPsoSwarmSize,
+ kArgHeuristicSelection, kArgPsoSwarmSize,
kArgPsoInfGlobal, kArgPsoInfLocal, kArgPsoInfRandom};
}
@@ -58,12 +58,11 @@ class TuneXgemm {
static size_t DefaultBatchCount() { return 1; } // N/A for this kernel
static double DefaultFraction() { return (V==1) ? 1.0 : 512.0; } // test all or sample randomly
static size_t DefaultNumRuns() { return 2; } // run every kernel this many times for averaging
- static size_t DefaultNumSearchStragegy() { return 2; } // Full search and Random/PSO
static size_t DefaultSwarmSizePSO() { return 8; }
static double DefaultInfluenceGlobalPSO(){ return 0.1; }
static double DefaultInfluenceLocalPSO(){ return 0.3; }
static double DefaultInfluenceRandomPSO(){ return 0.6; }
- static size_t DefaultHeuristic(){ return (size_t)cltune::SearchMethod::PSO;} // PSO
+ static size_t DefaultHeuristic(){ return static_cast<size_t> (cltune::SearchMethod::PSO);}
static double DefaultMaxTempAnn(){ return 1.0;}
// Describes how to obtain the sizes of the buffers
@@ -180,29 +179,18 @@ class TuneXgemm {
return 2 * args.m * args.n * args.k;
}
static std::string PerformanceUnit() { return "GFLOPS"; }
-
+
// Returns which Heuristic to run
- static size_t GetCurrentHeuristic(const Arguments<T> &args){
-
- // Multi Search Strategy is enable
- if( args.multi_search_strategy){
- if( V == 1){
- return (size_t) cltune::SearchMethod::FullSearch;
- }
- else{
- return args.heuristic_selection;
- }
- }
-
+ static size_t GetHeuristic(const Arguments<T> &args){
// Use full-search to explore all parameter combinations or random-search to search only a part of
// the parameter values. The fraction is set as a command-line argument.
if (args.fraction == 1.0 || args.fraction == 0.0) {
- return (size_t) cltune::SearchMethod::FullSearch;
+ return static_cast<size_t> (cltune::SearchMethod::FullSearch);
}
else {
return args.heuristic_selection;
}
- }
+ }
};
// =================================================================================================
@@ -226,35 +214,6 @@ void StartVariation(int argc, char *argv[]) {
}
}
-// Test multiple heuristics if kArgMultiSearchStrategy is enabled
-// Otherwise, run the heuristic specified in kArgMultiSearchStrategy
-void TestHeuristic(int argc, char *argv[]){
-
- auto command_line_args = clblast::RetrieveCommandLineArguments(argc, argv);
- auto help = std::string{""};
- auto heuristic_selected = clblast::GetArgument(command_line_args, help, clblast::kArgMultiSearchStrategy, 0);
- auto multi_search_strategy = clblast::GetArgument(command_line_args, help, clblast::kArgMultiSearchStrategy, 0);
-
- if(multi_search_strategy){
- StartVariation<1>(argc, argv);
- StartVariation<2>(argc, argv);
- }
- else
- {
- switch(heuristic_selected){
- case 1:
- case 2:
- case 3:
- StartVariation<2>(argc, argv);
- break;
- case 0:
- default:
- StartVariation<1>(argc, argv);
- break;
- }
- }
-}
-
// Main function (not within the clblast namespace)
int main(int argc, char *argv[]) {
StartVariation<1>(argc, argv);