diff options
author | Cedric Nugteren <web@cedricnugteren.nl> | 2017-10-01 20:32:39 +0200 |
---|---|---|
committer | Cedric Nugteren <web@cedricnugteren.nl> | 2017-10-01 20:32:39 +0200 |
commit | 6b226028d5a65adc24e8b474b88b1e5d6bfe6015 (patch) | |
tree | cd40361d6cb6f29e44f249a98bdd820c1591229d | |
parent | 1009303717d1722fd01ef43d1a08ee9d0899ad41 (diff) |
Allow OverrideParameters function to work before a kernel was first used
-rw-r--r-- | CHANGELOG | 1 | ||||
-rw-r--r-- | src/clblast.cpp | 9 |
2 files changed, 8 insertions, 2 deletions
@@ -1,6 +1,7 @@ Development (next version) - Kernels are now cached based on their tuning parameters: fits the use-case of 'OverrideParameters' +- Various minor fixes and enhancements Version 1.1.0 - The tuning database now has defaults per architecture (e.g. NVIDIA Kepler SM3.5, AMD Fiji) 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; |