summaryrefslogtreecommitdiff
path: root/src/clblast.cpp
diff options
context:
space:
mode:
authorCedric Nugteren <web@cedricnugteren.nl>2017-10-01 20:32:39 +0200
committerCedric Nugteren <web@cedricnugteren.nl>2017-10-01 20:32:39 +0200
commit6b226028d5a65adc24e8b474b88b1e5d6bfe6015 (patch)
treecd40361d6cb6f29e44f249a98bdd820c1591229d /src/clblast.cpp
parent1009303717d1722fd01ef43d1a08ee9d0899ad41 (diff)
Allow OverrideParameters function to work before a kernel was first used
Diffstat (limited to 'src/clblast.cpp')
-rw-r--r--src/clblast.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/clblast.cpp b/src/clblast.cpp
index bb338503..19d7ef0a 100644
--- a/src/clblast.cpp
+++ b/src/clblast.cpp
@@ -2497,8 +2497,13 @@ StatusCode OverrideParameters(const cl_device_id device, const std::string &kern
// Retrieves the current database values to verify whether the new ones are complete
auto in_cache = false;
- const auto current_database = DatabaseCache::Instance().Get(DatabaseKeyRef{platform_id, device, precision, kernel_name}, &in_cache);
- if (!in_cache) { return StatusCode::kInvalidOverrideKernel; }
+ auto current_database = DatabaseCache::Instance().Get(DatabaseKeyRef{platform_id, device, precision, kernel_name}, &in_cache);
+ if (!in_cache) {
+ log_debug("Searching database for kernel '" + kernel_name + "'");
+ current_database = Database(device_cpp, kernel_name, precision, {});
+ }
+
+ // Verifies the parameters size
const auto current_parameter_names = current_database.GetParameterNames();
if (current_parameter_names.size() != parameters.size()) {
return StatusCode::kMissingOverrideParameter;