summaryrefslogtreecommitdiff
path: root/src/database/database.hpp
diff options
context:
space:
mode:
authorCedric Nugteren <web@cedricnugteren.nl>2016-09-13 21:14:51 +0200
committerGitHub <noreply@github.com>2016-09-13 21:14:51 +0200
commitf07ac22f5b57d22756d779d2e53620f988d786ee (patch)
treee8bcbc331683ca6fd807f5a5b83bb05c6e6fed69 /src/database/database.hpp
parent7c13bacf129291e3e295ecb6e833788477085fa0 (diff)
parent4b94afda941a86f363064ff02f97e21eb9618794 (diff)
Merge pull request #99 from CNugteren/development
Update to version 0.9.0
Diffstat (limited to 'src/database/database.hpp')
-rw-r--r--src/database/database.hpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/database/database.hpp b/src/database/database.hpp
index 0987cbed..a6ab49c5 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 {
@@ -70,6 +71,8 @@ class Database {
static const DatabaseEntry XaxpyHalf, XaxpySingle, XaxpyDouble, XaxpyComplexSingle, XaxpyComplexDouble;
static const DatabaseEntry XdotHalf, XdotSingle, XdotDouble, XdotComplexSingle, XdotComplexDouble;
static const DatabaseEntry XgemvHalf, XgemvSingle, XgemvDouble, XgemvComplexSingle, XgemvComplexDouble;
+ static const DatabaseEntry XgemvFastHalf, XgemvFastSingle, XgemvFastDouble, XgemvFastComplexSingle, XgemvFastComplexDouble;
+ static const DatabaseEntry XgemvFastRotHalf, XgemvFastRotSingle, XgemvFastRotDouble, XgemvFastRotComplexSingle, XgemvFastRotComplexDouble;
static const DatabaseEntry XgerHalf, XgerSingle, XgerDouble, XgerComplexSingle, XgerComplexDouble;
static const DatabaseEntry XgemmHalf, XgemmSingle, XgemmDouble, XgemmComplexSingle, XgemmComplexDouble;
static const DatabaseEntry CopyHalf, CopySingle, CopyDouble, CopyComplexSingle, CopyComplexDouble;
@@ -78,9 +81,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 +92,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_;