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