diff options
author | mcian <mcian86@gmail.com> | 2017-07-23 14:48:13 +0200 |
---|---|---|
committer | mcian <mcian86@gmail.com> | 2017-07-23 14:48:13 +0200 |
commit | 473e81471895b35dcec5cb82e6beba134c544006 (patch) | |
tree | e4ff6df062b45644bc0ca8c0fb7640864128ad2f /src/utilities | |
parent | 8131e68664e02c8a1bc5a0f5598294fd3bc5b974 (diff) |
Code refactoring
Diffstat (limited to 'src/utilities')
-rw-r--r-- | src/utilities/utilities.hpp | 59 |
1 files changed, 23 insertions, 36 deletions
diff --git a/src/utilities/utilities.hpp b/src/utilities/utilities.hpp index 54214c49..e7e95bbb 100644 --- a/src/utilities/utilities.hpp +++ b/src/utilities/utilities.hpp @@ -28,21 +28,6 @@ #include "utilities/clblast_exceptions.hpp" #include "utilities/msvc.hpp" -#define FULL_SEARCH_STRATEGY 0 -#define RANDOM_SEARCH_STRATEGY 1 -#define PSO_STRATEGY 2 -#define DVDT_STRATEGY 3 - -#define DEFAULT_STRATEGY 0 - -#define DEFAULT_PSO_SWARM 8 -#define DEFAULT_PSO_G 0.3 -#define DEFAULT_PSO_L 0.6 -#define DEFAULT_PSO_R 0.1 - -#ifdef XGEMM_EXEC -extern bool tStrategyFlag; -#endif namespace clblast { // ================================================================================================= @@ -62,12 +47,6 @@ constexpr auto kUnknownError = -999; // ================================================================================================= -constexpr auto tStrategy = "strategy"; -constexpr auto psoSwarmSize = "psoSwarmSize"; -constexpr auto psoInfG = "psoInfG"; -constexpr auto psoInfL = "psoInfL"; -constexpr auto psoInfR = "psoInfR"; - // The routine-specific arguments in string form constexpr auto kArgM = "m"; constexpr auto kArgN = "n"; @@ -101,6 +80,15 @@ constexpr auto kArgBatchCount = "batch_num"; // The tuner-specific arguments in string form constexpr auto kArgFraction = "fraction"; +constexpr auto kArgHeuristicSelection = "heuristic"; +constexpr auto kArgMultiSearchStrategy = "multi_strategy"; +// PSO tuner-specific arguments in string form +constexpr auto kArgPsoSwarmSize = "pso_swarm_size"; +constexpr auto kArgPsoInfGlobal = "pso_inf_global"; +constexpr auto kArgPsoInfLocal = "pso_inf_local"; +constexpr auto kArgPsoInfRandom = "pso_inf_random"; +// Annealing tuner-specific arguments in string form +constexpr auto kArgAnnMaxTemp = "ann_max_temperature"; // The client-specific arguments in string form constexpr auto kArgCompareclblas = "clblas"; @@ -193,13 +181,13 @@ struct Arguments { T beta = ConstantOne<T>(); // Batch-specific arguments size_t batch_count = 1; - std::vector<size_t> x_offsets = {0}; - std::vector<size_t> y_offsets = {0}; - std::vector<size_t> a_offsets = {0}; - std::vector<size_t> b_offsets = {0}; - std::vector<size_t> c_offsets = {0}; - std::vector<T> alphas = {ConstantOne<T>()}; - std::vector<T> betas = {ConstantOne<T>()}; + std::vector<size_t> x_offsets; // = {0}; + std::vector<size_t> y_offsets; // = {0}; + std::vector<size_t> a_offsets; // = {0}; + std::vector<size_t> b_offsets; // = {0}; + std::vector<size_t> c_offsets; // = {0}; + std::vector<T> alphas; // = {ConstantOne<T>()}; + std::vector<T> betas; // = {ConstantOne<T>()}; // Sizes size_t x_size = 1; size_t y_size = 1; @@ -209,7 +197,14 @@ struct Arguments { size_t ap_size = 1; size_t scalar_size = 1; // Tuner-specific arguments + size_t heuristic_selection = 0; + size_t multi_search_strategy = 0; double fraction = 1.0; + size_t pso_swarm_size = 8; + double pso_inf_global = 0.3; + double pso_inf_local = 0.6; + double pso_inf_random = 0.1; + double ann_max_temperature = 1.0; // Is it a valid default value? // Client-specific arguments int compare_clblas = 1; int compare_cblas = 1; @@ -227,16 +222,8 @@ struct Arguments { bool print_help = false; bool silent = false; bool no_abbrv = false; - - int tStrategy = DEFAULT_STRATEGY; - size_t psoSwarmSize = DEFAULT_PSO_SWARM; - double psoInfG = DEFAULT_PSO_G; - double psoInfL = DEFAULT_PSO_L; - double psoInfR = DEFAULT_PSO_R; }; - - // Structure containing all possible buffers for test clients template <typename T> struct Buffers { |