diff options
author | Cedric Nugteren <web@cedricnugteren.nl> | 2016-07-24 17:06:27 +0200 |
---|---|---|
committer | Cedric Nugteren <web@cedricnugteren.nl> | 2016-07-24 17:06:27 +0200 |
commit | 0252df731ab21d4acd5dfe53733e3c1bd0c18200 (patch) | |
tree | fae635b9978bf570e2c56735d77c25628f6bbd0c /src/database/database.hpp | |
parent | 40a72259eba491631d8875aae465c5a93d7fed02 (diff) | |
parent | ffa35c623af4b0916f625f3a41000e75a1df7e1f (diff) |
Merge branch 'development' into gemv_performance
Diffstat (limited to 'src/database/database.hpp')
-rw-r--r-- | src/database/database.hpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/database/database.hpp b/src/database/database.hpp index 0987cbed..e84357dc 100644 --- a/src/database/database.hpp +++ b/src/database/database.hpp @@ -32,6 +32,7 @@ class Database { // Type alias for the database parameters using Parameters = std::unordered_map<std::string,size_t>; + using ParametersPtr = const Parameters*; // Structures for content inside the database struct DatabaseDevice { @@ -78,9 +79,9 @@ class Database { static const DatabaseEntry PadtransposeHalf, PadtransposeSingle, PadtransposeDouble, PadtransposeComplexSingle, PadtransposeComplexDouble; static const std::vector<DatabaseEntry> database; - // The constructor + // The constructor with a user-provided database overlay (potentially an empty vector) explicit Database(const Queue &queue, const std::vector<std::string> &routines, - const Precision precision); + const Precision precision, const std::vector<DatabaseEntry> &overlay); // Accessor of values by key size_t operator[](const std::string key) const { return parameters_.find(key)->second; } @@ -89,9 +90,10 @@ class Database { std::string GetDefines() const; private: - Parameters Search(const std::string &this_kernel, const std::string &this_type, - const std::string &this_vendor, const std::string &this_device, - const Precision this_precision) const; + // Search method for a specified database, returning pointer (possibly a nullptr) + ParametersPtr Search(const std::string &this_kernel, const std::string &this_type, + const std::string &this_vendor, const std::string &this_device, + const Precision this_precision, const std::vector<DatabaseEntry> &db) const; // Found parameters suitable for this device/kernel Parameters parameters_; |