summaryrefslogtreecommitdiff
path: root/src/gallium/frontends/clover/core/device.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/frontends/clover/core/device.cpp')
-rw-r--r--src/gallium/frontends/clover/core/device.cpp26
1 files changed, 23 insertions, 3 deletions
diff --git a/src/gallium/frontends/clover/core/device.cpp b/src/gallium/frontends/clover/core/device.cpp
index d9bd2d00f04..7ef66d50492 100644
--- a/src/gallium/frontends/clover/core/device.cpp
+++ b/src/gallium/frontends/clover/core/device.cpp
@@ -440,9 +440,17 @@ device::device_version_as_string() const {
std::string
device::device_clc_version_as_string() const {
+ int major = CL_VERSION_MAJOR(clc_version);
+ int minor = CL_VERSION_MINOR(clc_version);
+
+ /* for CL 3.0 we need this to be 1.2 until we support 2.0. */
+ if (major == 3) {
+ major = 1;
+ minor = 2;
+ }
static const std::string version_string =
- std::to_string(CL_VERSION_MAJOR(clc_version)) + "." +
- std::to_string(CL_VERSION_MINOR(clc_version));
+ std::to_string(major) + "." +
+ std::to_string(minor);
return version_string;
}
@@ -510,7 +518,19 @@ device::device_version() const {
}
cl_version
-device::device_clc_version() const {
+device::device_clc_version(bool api) const {
+ /*
+ * For the API we have to limit this to 1.2,
+ * but internally we want 3.0 if it works.
+ */
+ if (!api)
+ return clc_version;
+
+ int major = CL_VERSION_MAJOR(clc_version);
+ /* for CL 3.0 we need this to be 1.2 until we support 2.0. */
+ if (major == 3) {
+ return CL_MAKE_VERSION(1, 2, 0);
+ }
return clc_version;
}