summaryrefslogtreecommitdiff
path: root/src/routine.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/routine.hpp')
-rw-r--r--src/routine.hpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/routine.hpp b/src/routine.hpp
index 2d8b2415..f366e4d9 100644
--- a/src/routine.hpp
+++ b/src/routine.hpp
@@ -35,11 +35,22 @@ class Routine {
// 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.
+ // NOTE: the caller must provide the same userDatabase for each combination of device, precision
+ // and routine list, otherwise the caching logic will break.
explicit Routine(Queue &queue, EventPointer event, const std::string &name,
const std::vector<std::string> &routines, const Precision precision,
const std::vector<const Database::DatabaseEntry*> &userDatabase,
std::initializer_list<const char *> source);
+ private:
+
+ // Initializes program_, fetching cached program or building one
+ void InitProgram(std::initializer_list<const char *> source);
+
+ // Initializes db_, fetching cached database or building one
+ void InitDatabase(const std::vector<std::string> &routines,
+ const std::vector<const Database::DatabaseEntry*> &userDatabase);
+
protected:
// Non-static variable for the precision
@@ -57,8 +68,11 @@ class Routine {
// OpenCL device properties
const std::string device_name_;
+ // Compiled program (either retrieved from cache or compiled in slow path)
+ Program program_;
+
// Connection to the database for all the device-specific parameters
- const Database db_;
+ Database db_;
};
// =================================================================================================