From d9b21d7f4920b115d3fe7f2e3cce1f89eb762c10 Mon Sep 17 00:00:00 2001 From: Cedric Nugteren Date: Thu, 28 Apr 2016 21:14:17 +0200 Subject: Fixed the cache to store binaries instead of OpenCL programs --- include/internal/routine.h | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'include/internal/routine.h') 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(); + 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 -- cgit v1.2.3