From a6294d0b7a0bae75c67598426b0b2264b018c2cb Mon Sep 17 00:00:00 2001
From: Andreas Kloeckner <inform@tiker.net>
Date: Sat, 28 Jul 2012 16:18:52 -0400
Subject: [PATCH] Don't expose clCreateProgramWithBuiltInKernels on Apple CL
 1.2.

(reported by Bogdan Opanchuk)
---
 src/wrapper/wrap_cl.hpp        | 5 ++++-
 src/wrapper/wrap_cl_part_2.cpp | 3 ++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/wrapper/wrap_cl.hpp b/src/wrapper/wrap_cl.hpp
index 90c9a3f8..9efedf76 100644
--- a/src/wrapper/wrap_cl.hpp
+++ b/src/wrapper/wrap_cl.hpp
@@ -3006,7 +3006,8 @@ namespace pyopencl
 
 
 
-#if PYOPENCL_CL_VERSION >= 0x1020
+#if (PYOPENCL_CL_VERSION >= 0x1020) && \
+      ((PYOPENCL_CL_VERSION >= 0x1030) && defined(__APPLE__))
   inline
   program *create_program_with_built_in_kernels(
       context &ctx,
@@ -3033,9 +3034,11 @@ namespace pyopencl
       throw;
     }
   }
+#endif
 
 
 
+#if PYOPENCL_CL_VERSION >= 0x1020
   inline
   program *link_program(
       context &ctx,
diff --git a/src/wrapper/wrap_cl_part_2.cpp b/src/wrapper/wrap_cl_part_2.cpp
index 3205c2e1..cc7942c8 100644
--- a/src/wrapper/wrap_cl_part_2.cpp
+++ b/src/wrapper/wrap_cl_part_2.cpp
@@ -196,7 +196,8 @@ void pyopencl_expose_part_2()
             create_program_with_binary,
             py::default_call_policies(),
             py::args("context", "devices", "binaries")))
-#if PYOPENCL_CL_VERSION >= 0x1020
+#if (PYOPENCL_CL_VERSION >= 0x1020) && \
+      ((PYOPENCL_CL_VERSION >= 0x1030) && defined(__APPLE__))
       .def("create_with_built_in_kernels",
           create_program_with_built_in_kernels,
           py::args("context", "devices", "kernel_names"),
-- 
GitLab