summaryrefslogtreecommitdiff
path: root/src/database/database.hpp
diff options
context:
space:
mode:
authorCedric Nugteren <web@cedricnugteren.nl>2016-07-24 16:48:20 +0200
committerGitHub <noreply@github.com>2016-07-24 16:48:20 +0200
commitd4ffa6395ec7d6f4aa9ca52d0705db0f34c72eba (patch)
tree78cede59741be9f4d95c26648e4d51fa9391a7ea /src/database/database.hpp
parent622682ffe30ae4e250d53a88eaacd899c905e20b (diff)
parente4e1f05079273f60f4f15280b3f103810c7eb31f (diff)
Merge pull request #84 from intelfx/device-specific-kernels
Groundwork for device-specific routines
Diffstat (limited to 'src/database/database.hpp')
-rw-r--r--src/database/database.hpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/database/database.hpp b/src/database/database.hpp
index 0987cbed..5a61fad9 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
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; }
@@ -93,6 +94,11 @@ class Database {
const std::string &this_vendor, const std::string &this_device,
const Precision this_precision) const;
+ // Alternate search method in a specified database, returning pointer (possibly NULL)
+ 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_;
};