summaryrefslogtreecommitdiff
path: root/include/internal/routine.h
diff options
context:
space:
mode:
authorCedric Nugteren <web@cedricnugteren.nl>2016-04-28 21:14:17 +0200
committerCedric Nugteren <web@cedricnugteren.nl>2016-04-28 21:14:17 +0200
commitd9b21d7f4920b115d3fe7f2e3cce1f89eb762c10 (patch)
treec9a44f189fce5f6fc2456604dfe4c9d3e951e4e0 /include/internal/routine.h
parentd7ddbdeb1f416f56bc469d16c051551207274703 (diff)
Fixed the cache to store binaries instead of OpenCL programs
Diffstat (limited to 'include/internal/routine.h')
-rw-r--r--include/internal/routine.h16
1 files changed, 10 insertions, 6 deletions
diff --git a/include/internal/routine.h b/include/internal/routine.h
index 013769d8..32be6012 100644
--- a/include/internal/routine.h
+++ b/include/internal/routine.h
@@ -84,19 +84,23 @@ class Routine {
const bool upper = false, const bool lower = false,
const bool diagonal_imag_zero = false);
- // Stores a newly compiled program into the cache
- void StoreProgramToCache(const Program& program) const {
- return cache::StoreProgramToCache(program, device_name_, precision_, routine_name_);
+ // Stores a newly compiled binary into the cache
+ void StoreBinaryToCache(const std::string& binary) const {
+ return cache::StoreBinaryToCache(binary, device_name_, precision_, routine_name_);
}
// Queries the cache and retrieve either a matching program or a boolean whether a match exists.
// The first assumes that the program is available in the cache and will throw an exception
// otherwise.
- const Program& GetProgramFromCache() const {
- return cache::GetProgramFromCache(device_name_, precision_, routine_name_);
+ Program GetProgramFromCache() const {
+ auto& binary = cache::GetBinaryFromCache(device_name_, precision_, routine_name_);
+ auto program = Program(device_, context_, binary);
+ auto options = std::vector<std::string>();
+ program.Build(device_, options);
+ return program;
}
bool ProgramIsInCache() const {
- return cache::ProgramIsInCache(device_name_, precision_, routine_name_);
+ return cache::BinaryIsInCache(device_name_, precision_, routine_name_);
}
// Non-static variable for the precision. Note that the same variable (but static) might exist in