summaryrefslogtreecommitdiff
path: root/src/routine.hpp
diff options
context:
space:
mode:
authorCedric Nugteren <web@cedricnugteren.nl>2017-12-28 14:46:45 +0100
committerCedric Nugteren <web@cedricnugteren.nl>2017-12-28 14:46:45 +0100
commit6d1e30e61f5ef73f0a83e12f064cae64644034ca (patch)
treea8874ae7db89acbce71ccf2be560dd13309012b4 /src/routine.hpp
parentaaea9474a154a9f07534523e4ca66e4b2c5f2d4f (diff)
Added interface to compute the required temporary buffer size for GEMM
Diffstat (limited to 'src/routine.hpp')
-rw-r--r--src/routine.hpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/routine.hpp b/src/routine.hpp
index a8f1cb6a..00f7b5cc 100644
--- a/src/routine.hpp
+++ b/src/routine.hpp
@@ -33,6 +33,26 @@ namespace clblast {
class Routine {
public:
+ static void InitDatabase(const Device &device, const std::vector<std::string> &kernel_names,
+ const Precision precision, const std::vector<database::DatabaseEntry> &userDatabase,
+ Databases &db) {
+ const auto platform_id = device.PlatformID();
+ for (const auto &kernel_name : kernel_names) {
+
+ // Queries the cache to see whether or not the kernel parameter database is already there
+ bool has_db;
+ db(kernel_name) = DatabaseCache::Instance().Get(DatabaseKeyRef{platform_id, device(), precision, kernel_name},
+ &has_db);
+ if (has_db) { continue; }
+
+ // Builds the parameter database for this device and routine set and stores it in the cache
+ log_debug("Searching database for kernel '" + kernel_name + "'");
+ db(kernel_name) = Database(device, kernel_name, precision, userDatabase);
+ DatabaseCache::Instance().Store(DatabaseKey{platform_id, device(), precision, kernel_name},
+ Database{db(kernel_name)});
+ }
+ }
+
// Base class constructor. The user database is an optional extra database to override the
// built-in database.
// All heavy preparation work is done inside this constructor.