diff options
-rw-r--r-- | include/internal/utilities.h | 6 | ||||
-rw-r--r-- | src/utilities.cc | 14 | ||||
-rw-r--r-- | test/correctness/tester.cc | 14 | ||||
-rw-r--r-- | test/correctness/tester.h | 4 |
4 files changed, 20 insertions, 18 deletions
diff --git a/include/internal/utilities.h b/include/internal/utilities.h index 6dba24e1..d9fdb9ab 100644 --- a/include/internal/utilities.h +++ b/include/internal/utilities.h @@ -198,6 +198,12 @@ bool IsMultiple(const size_t a, const size_t b); size_t GetBytes(const Precision precision); // ================================================================================================= + +// Returns false is this precision is not supported by the device +template <typename T> +bool PrecisionSupported(const Device &device); + +// ================================================================================================= } // namespace clblast // CLBLAST_UTILITIES_H_ diff --git a/src/utilities.cc b/src/utilities.cc index 62abbb91..042b3116 100644 --- a/src/utilities.cc +++ b/src/utilities.cc @@ -271,4 +271,18 @@ size_t GetBytes(const Precision precision) { } // ================================================================================================= + +// Returns false is this precision is not supported by the device +template <> bool PrecisionSupported<float>(const Device &) { return true; } +template <> bool PrecisionSupported<float2>(const Device &) { return true; } +template <> bool PrecisionSupported<double>(const Device &device) { + auto extensions = device.Capabilities(); + return (extensions.find(kKhronosDoublePrecision) == std::string::npos) ? false : true; +} +template <> bool PrecisionSupported<double2>(const Device &device) { + auto extensions = device.Capabilities(); + return (extensions.find(kKhronosDoublePrecision) == std::string::npos) ? false : true; +} + +// ================================================================================================= } // namespace clblast diff --git a/test/correctness/tester.cc b/test/correctness/tester.cc index 002cb1a6..a52142c4 100644 --- a/test/correctness/tester.cc +++ b/test/correctness/tester.cc @@ -335,20 +335,6 @@ template <> const std::vector<double2> GetExampleScalars(const bool full_test) { // ================================================================================================= -// Returns false is this precision is not supported by the device -template <> bool PrecisionSupported<float>(const Device &) { return true; } -template <> bool PrecisionSupported<float2>(const Device &) { return true; } -template <> bool PrecisionSupported<double>(const Device &device) { - auto extensions = device.Capabilities(); - return (extensions.find(kKhronosDoublePrecision) == std::string::npos) ? false : true; -} -template <> bool PrecisionSupported<double2>(const Device &device) { - auto extensions = device.Capabilities(); - return (extensions.find(kKhronosDoublePrecision) == std::string::npos) ? false : true; -} - -// ================================================================================================= - // Compiles the templated class template class Tester<float, float>; template class Tester<double, double>; diff --git a/test/correctness/tester.h b/test/correctness/tester.h index 06f4afbe..db714f3d 100644 --- a/test/correctness/tester.h +++ b/test/correctness/tester.h @@ -140,10 +140,6 @@ bool TestSimilarity(const T val1, const T val2); template <typename T> const std::vector<T> GetExampleScalars(const bool full_test); -// Returns false is this precision is not supported by the device -template <typename T> -bool PrecisionSupported(const Device &device); - // ================================================================================================= } // namespace clblast |