summaryrefslogtreecommitdiff
path: root/src/cache.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/cache.hpp')
-rw-r--r--src/cache.hpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/cache.hpp b/src/cache.hpp
index c3675f07..694de839 100644
--- a/src/cache.hpp
+++ b/src/cache.hpp
@@ -42,6 +42,10 @@ public:
void Store(Key &&key, Value &&value);
void Invalidate();
+ // Removes all entries with a given key
+ void Remove(const Key &key);
+ template <int I1, int I2> void RemoveBySubset(const Key &key); // currently supports 2 indices
+
static Cache<Key, Value> &Instance();
private:
@@ -72,7 +76,6 @@ typedef Cache<BinaryKey, std::string> BinaryCache;
extern template class Cache<BinaryKey, std::string>;
extern template std::string BinaryCache::Get(const BinaryKeyRef &, bool *) const;
-
// =================================================================================================
// The key struct for the cache of compiled OpenCL programs (context-dependent)
@@ -90,9 +93,9 @@ extern template Program ProgramCache::Get(const ProgramKeyRef &, bool *) const;
class Database;
// The key struct for the cache of database maps.
-// Order of fields: precision, device_name, routines (smaller fields first)
-typedef std::tuple<Precision, std::string, std::vector<std::string>> DatabaseKey;
-typedef std::tuple<const Precision &, const std::string &, const std::vector<std::string> &> DatabaseKeyRef;
+// Order of fields: precision, device_name, kernel_name (smaller fields first)
+typedef std::tuple<Precision, std::string, std::string> DatabaseKey;
+typedef std::tuple<const Precision &, const std::string &, const std::string &> DatabaseKeyRef;
typedef Cache<DatabaseKey, Database> DatabaseCache;