diff options
author | Cedric Nugteren <web@cedricnugteren.nl> | 2017-10-08 10:29:47 +0200 |
---|---|---|
committer | Cedric Nugteren <web@cedricnugteren.nl> | 2017-10-08 10:29:47 +0200 |
commit | 3598762029ad67ab0a85ca2b5307a26c9d4564ca (patch) | |
tree | 4450e4c7c0a91c49068cacb009f735d18f2d3d98 /src/utilities | |
parent | 6d3e1212f03bcd819dca0fe5a75330b92f11b81f (diff) |
Moved the remaining OpenCL specific host code to the clpp11.h header where it belongs
Diffstat (limited to 'src/utilities')
-rw-r--r-- | src/utilities/utilities.cpp | 13 | ||||
-rw-r--r-- | src/utilities/utilities.hpp | 4 |
2 files changed, 4 insertions, 13 deletions
diff --git a/src/utilities/utilities.cpp b/src/utilities/utilities.cpp index 4b8d5a09..a5c1d45e 100644 --- a/src/utilities/utilities.cpp +++ b/src/utilities/utilities.cpp @@ -391,16 +391,9 @@ template <> Precision PrecisionValue<double2>() { return Precision::kComplexDoub // 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) { - return device.HasExtension(kKhronosDoublePrecision); -} -template <> bool PrecisionSupported<double2>(const Device &device) { - return device.HasExtension(kKhronosDoublePrecision); -} -template <> bool PrecisionSupported<half>(const Device &device) { - if (device.Name() == "Mali-T628") { return true; } // supports fp16 but not cl_khr_fp16 officially - return device.HasExtension(kKhronosHalfPrecision); -} +template <> bool PrecisionSupported<double>(const Device &device) { return device.SupportsFP64(); } +template <> bool PrecisionSupported<double2>(const Device &device) { return device.SupportsFP64(); } +template <> bool PrecisionSupported<half>(const Device &device) { return device.SupportsFP16(); } // ================================================================================================= diff --git a/src/utilities/utilities.hpp b/src/utilities/utilities.hpp index e45c606c..b2949c27 100644 --- a/src/utilities/utilities.hpp +++ b/src/utilities/utilities.hpp @@ -31,15 +31,13 @@ namespace clblast { // ================================================================================================= // Shorthands for half-precision -using half = cl_half; // based on the OpenCL type, which is actually an 'unsigned short' +using half = unsigned short; // the 'cl_half' OpenCL type is actually an 'unsigned short' // Shorthands for complex data-types using float2 = std::complex<float>; using double2 = std::complex<double>; // Khronos OpenCL extensions -const std::string kKhronosHalfPrecision = "cl_khr_fp16"; -const std::string kKhronosDoublePrecision = "cl_khr_fp64"; const std::string kKhronosAttributesAMD = "cl_amd_device_attribute_query"; const std::string kKhronosAttributesNVIDIA = "cl_nv_device_attribute_query"; |