summaryrefslogtreecommitdiff
path: root/src/utilities/utilities.hpp
diff options
context:
space:
mode:
authormcian <mcian86@gmail.com>2017-07-17 12:00:25 +0200
committermcian <mcian86@gmail.com>2017-07-17 12:00:25 +0200
commit8131e68664e02c8a1bc5a0f5598294fd3bc5b974 (patch)
tree62b40c06ed312a98e2f64a71f66053df630a5918 /src/utilities/utilities.hpp
parentf2477f663672fd37301d6e2ce4646519f71d5cce (diff)
Add PSO parameters support and search strategy selection from command line
Diffstat (limited to 'src/utilities/utilities.hpp')
-rw-r--r--src/utilities/utilities.hpp43
1 files changed, 36 insertions, 7 deletions
diff --git a/src/utilities/utilities.hpp b/src/utilities/utilities.hpp
index 03051354..54214c49 100644
--- a/src/utilities/utilities.hpp
+++ b/src/utilities/utilities.hpp
@@ -28,6 +28,21 @@
#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 {
// =================================================================================================
@@ -47,6 +62,12 @@ 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";
@@ -172,13 +193,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;
@@ -206,8 +227,16 @@ 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 {