From 66a473455e3c6fa206c0efacccb61a8f9785e279 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 6 Jan 2020 17:34:26 -0500 Subject: [PATCH] silence warnings from generic OpenCL header files (as seen on Fedora 31) --- lib/gpu/geryon/ocl_device.h | 8 ++++++++ lib/gpu/geryon/ocl_macros.h | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/lib/gpu/geryon/ocl_device.h b/lib/gpu/geryon/ocl_device.h index 14455e38a5..e414e7b69c 100644 --- a/lib/gpu/geryon/ocl_device.h +++ b/lib/gpu/geryon/ocl_device.h @@ -28,6 +28,14 @@ #include #include +/* We default to OpenCL 1.2 as target version for now as + * there are known issues with OpenCL 2.0 and later. + * This is also to silence warnings from generic OpenCL headers */ + +#if !defined(CL_TARGET_OPENCL_VERSION) +#define CL_TARGET_OPENCL_VERSION 120 +#endif + #ifdef __APPLE__ #include #include diff --git a/lib/gpu/geryon/ocl_macros.h b/lib/gpu/geryon/ocl_macros.h index 5fb7665817..aeff689859 100644 --- a/lib/gpu/geryon/ocl_macros.h +++ b/lib/gpu/geryon/ocl_macros.h @@ -4,6 +4,14 @@ #include #include +/* We default to OpenCL 1.2 as target version for now as + * there are known issues with OpenCL 2.0 and later. + * This is also to silence warnings from generic OpenCL headers */ + +#if !defined(CL_TARGET_OPENCL_VERSION) +#define CL_TARGET_OPENCL_VERSION 120 +#endif + #ifdef __APPLE__ #include #else