summaryrefslogtreecommitdiff
path: root/src/utilities/utilities.cpp
diff options
context:
space:
mode:
authorCedric Nugteren <web@cedricnugteren.nl>2019-05-11 20:39:00 +0200
committerCedric Nugteren <web@cedricnugteren.nl>2019-05-11 20:39:00 +0200
commitaf6a9eedd118b0e3d7f1a2098c10ff90b27b5d0e (patch)
treea5644ea6de5a2b72772238d35741072c5db54486 /src/utilities/utilities.cpp
parent9cbffc9b7cbcfa6d6c8a048c45c1ad52d22effb3 (diff)
Added a function to set the OpenCL kernel standard, either 1.1 or 1.2
Diffstat (limited to 'src/utilities/utilities.cpp')
-rw-r--r--src/utilities/utilities.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/utilities/utilities.cpp b/src/utilities/utilities.cpp
index a0e89c98..29161e74 100644
--- a/src/utilities/utilities.cpp
+++ b/src/utilities/utilities.cpp
@@ -498,6 +498,19 @@ std::string GetDeviceName(const Device& device) {
// =================================================================================================
+void SetOpenCLKernelStandard(const Device &device, std::vector<std::string> &options) {
+ // Inclusion of one of the following extensions needs OpenCL 1.2 kernels
+ if (device.HasExtension(kKhronosIntelSubgroups)) {
+ options.push_back("-cl-std=CL1.2");
+ }
+ // Otherwise we fall-back to the default CLBlast OpenCL 1.1
+ else {
+ options.push_back("-cl-std=CL1.1");
+ }
+}
+
+// =================================================================================================
+
// Solve Bezout's identity
// a * p + b * q = r = GCD(a, b)
void EuclidGCD(int a, int b, int &p, int &q, int &r) {