Mesa (master): clover: Avoid warnings from new OpenCL headers

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Feb 26 20:02:18 UTC 2019


Module: Mesa
Branch: master
Commit: 669d00ba4cabf444de12eb3663c5251b519e1681
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=669d00ba4cabf444de12eb3663c5251b519e1681

Author: Pierre Moreau <pierre.morrow at free.fr>
Date:   Fri Feb  1 12:33:37 2019 +0100

clover: Avoid warnings from new OpenCL headers

* Avoid warnings from references to deprecated CL 1.0, 1.2, 2.0 and 2.1 APIs.
* Avoid warnings from not defining CL_TARGET_OPENCL_VERSION.

Reviewed-by: Karol Herbst <kherbst at redhat.com>
Reviewed-by: Francisco Jerez <currojerez at riseup.net>

---

 src/gallium/state_trackers/clover/api/dispatch.hpp        | 7 +++++++
 src/gallium/state_trackers/clover/core/error.hpp          | 1 +
 src/gallium/state_trackers/clover/core/object.hpp         | 1 +
 src/gallium/state_trackers/clover/llvm/codegen/common.cpp | 1 +
 4 files changed, 10 insertions(+)

diff --git a/src/gallium/state_trackers/clover/api/dispatch.hpp b/src/gallium/state_trackers/clover/api/dispatch.hpp
index 84b992af9ba..ec924fef7d7 100644
--- a/src/gallium/state_trackers/clover/api/dispatch.hpp
+++ b/src/gallium/state_trackers/clover/api/dispatch.hpp
@@ -23,7 +23,14 @@
 #ifndef API_DISPATCH_HPP
 #define API_DISPATCH_HPP
 
+#define CL_TARGET_OPENCL_VERSION 220
+
+#define CL_USE_DEPRECATED_OPENCL_1_0_APIS
 #define CL_USE_DEPRECATED_OPENCL_1_1_APIS
+#define CL_USE_DEPRECATED_OPENCL_1_2_APIS
+#define CL_USE_DEPRECATED_OPENCL_2_0_APIS
+#define CL_USE_DEPRECATED_OPENCL_2_1_APIS
+
 
 #include "CL/cl.h"
 #include "CL/cl_ext.h"
diff --git a/src/gallium/state_trackers/clover/core/error.hpp b/src/gallium/state_trackers/clover/core/error.hpp
index 0490c19a276..a38bbfa53c1 100644
--- a/src/gallium/state_trackers/clover/core/error.hpp
+++ b/src/gallium/state_trackers/clover/core/error.hpp
@@ -23,6 +23,7 @@
 #ifndef CLOVER_CORE_ERROR_HPP
 #define CLOVER_CORE_ERROR_HPP
 
+#define CL_TARGET_OPENCL_VERSION 220
 #include "CL/cl.h"
 
 #include <stdexcept>
diff --git a/src/gallium/state_trackers/clover/core/object.hpp b/src/gallium/state_trackers/clover/core/object.hpp
index e3a5ab7fafd..748fe9a12e8 100644
--- a/src/gallium/state_trackers/clover/core/object.hpp
+++ b/src/gallium/state_trackers/clover/core/object.hpp
@@ -27,6 +27,7 @@
 #include <functional>
 #include <vector>
 
+#define CL_TARGET_OPENCL_VERSION 220
 #include "CL/cl.h"
 
 #include "core/error.hpp"
diff --git a/src/gallium/state_trackers/clover/llvm/codegen/common.cpp b/src/gallium/state_trackers/clover/llvm/codegen/common.cpp
index ca5f78940d2..98a9d5ffb5e 100644
--- a/src/gallium/state_trackers/clover/llvm/codegen/common.cpp
+++ b/src/gallium/state_trackers/clover/llvm/codegen/common.cpp
@@ -33,6 +33,7 @@
 #include "llvm/codegen.hpp"
 #include "llvm/metadata.hpp"
 
+#define CL_TARGET_OPENCL_VERSION 220
 #include "CL/cl.h"
 
 #include "pipe/p_state.h"




More information about the mesa-commit mailing list