diff --git a/pyopencl/_cluda.py b/pyopencl/_cluda.py
index 40b2fad7bcdc8b38c3c580647f28dac8d65f3a40..5e0c1b6ac1d409cf11b65666a1b8ae06f9284e16 100644
--- a/pyopencl/_cluda.py
+++ b/pyopencl/_cluda.py
@@ -20,9 +20,6 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 THE SOFTWARE.
 """
 
-
-
-
 CLUDA_PREAMBLE = """
 #define local_barrier() barrier(CLK_LOCAL_MEM_FENCE);
 
@@ -50,12 +47,8 @@ CLUDA_PREAMBLE = """
 #define GDIM_2 get_num_groups(2)
 
 % if double_support:
-    #if __OPENCL_VERSION__ <= CL_VERSION_1_1
+    #if __OPENCL_C_VERSION__ < 120
     #pragma OPENCL EXTENSION cl_khr_fp64: enable
     #endif
 % endif
 """
-
-
-
-
diff --git a/pyopencl/algorithm.py b/pyopencl/algorithm.py
index 286fdbddcd7b58cd41e05143be1f6ca2b124bb08..387e31a4d0a455368ca45bef287220b5f9ead72e 100644
--- a/pyopencl/algorithm.py
+++ b/pyopencl/algorithm.py
@@ -558,7 +558,7 @@ class RadixSort(object):
 
 _LIST_BUILDER_TEMPLATE = Template("""//CL//
 % if double_support:
-    #if __OPENCL_VERSION__ <= CL_VERSION_1_1
+    #if __OPENCL_C_VERSION__ < 120
     #pragma OPENCL EXTENSION cl_khr_fp64: enable
     #endif
     #define PYOPENCL_DEFINE_CDOUBLE
diff --git a/pyopencl/clrandom.py b/pyopencl/clrandom.py
index b8176c4c19bc8aced1f1d596083692f12c628b38..2fc377cb38e32dc8ffd5543f15008fe3f94a30ed 100644
--- a/pyopencl/clrandom.py
+++ b/pyopencl/clrandom.py
@@ -168,7 +168,7 @@ class RanluxGenerator(object):
         lines = []
         if include_double_pragma and self.support_double:
             lines.append("""
-                #if __OPENCL_VERSION__ <= CL_VERSION_1_1
+                #if __OPENCL_C_VERSION__ < 120
                 #pragma OPENCL EXTENSION cl_khr_fp64: enable
                 #endif
                 """)
diff --git a/pyopencl/elementwise.py b/pyopencl/elementwise.py
index 0291d4bde0e25dfb639b04d866b648e6c3401917..398936ff52587b91a48d0febec06a7e172d80019 100644
--- a/pyopencl/elementwise.py
+++ b/pyopencl/elementwise.py
@@ -127,7 +127,7 @@ def get_elwise_kernel_and_types(context, arguments, operation,
             if arg.dtype in [np.float64, np.complex128]:
                 if not have_double_pragma:
                     pragmas.append("""
-                        #if __OPENCL_VERSION__ <= CL_VERSION_1_1
+                        #if __OPENCL_C_VERSION__ < 120
                         #pragma OPENCL EXTENSION cl_khr_fp64: enable
                         #endif
                         #define PYOPENCL_DEFINE_CDOUBLE
@@ -846,7 +846,7 @@ def get_float_binary_func_kernel(context, func_name, x_dtype, y_dtype,
     if (np.array(0, x_dtype) * np.array(0, y_dtype)).itemsize > 4:
         arg_type = 'double'
         preamble = """
-        #if __OPENCL_VERSION__ <= CL_VERSION_1_1
+        #if __OPENCL_C_VERSION__ < 120
         #pragma OPENCL EXTENSION cl_khr_fp64: enable
         #endif
         #define PYOPENCL_DEFINE_CDOUBLE
@@ -920,7 +920,7 @@ def get_bessel_kernel(context, which_func, out_dtype=np.float64,
         "z[i] = bessel_%sn(ord_n, x[i])" % which_func,
         name="bessel_%sn_kernel" % which_func,
         preamble="""
-        #if __OPENCL_VERSION__ <= CL_VERSION_1_1
+        #if __OPENCL_C_VERSION__ < 120
         #pragma OPENCL EXTENSION cl_khr_fp64: enable
         #endif
         #define PYOPENCL_DEFINE_CDOUBLE
diff --git a/pyopencl/reduction.py b/pyopencl/reduction.py
index efa210436fdbeb87f5347caf903244bb5ae4399e..ba7c6dc77f69337c8e535284a782e31eb9b613a4 100644
--- a/pyopencl/reduction.py
+++ b/pyopencl/reduction.py
@@ -47,7 +47,7 @@ KERNEL = """//CL//
     #define REDUCE(a, b) (${reduce_expr})
 
     % if double_support:
-        #if __OPENCL_VERSION__ <= CL_VERSION_1_1
+        #if __OPENCL_C_VERSION__ < 120
         #pragma OPENCL EXTENSION cl_khr_fp64: enable
         #endif
         #define PYOPENCL_DEFINE_CDOUBLE
diff --git a/pyopencl/tools.py b/pyopencl/tools.py
index e9baa815a065090e1e1d6508d33f01d6524160fd..7119190612ae0bfde19238751005e1ecc88341e5 100644
--- a/pyopencl/tools.py
+++ b/pyopencl/tools.py
@@ -491,7 +491,7 @@ class _CDeclList:
         if self.saw_double:
             result = (
                     """
-                    #if __OPENCL_VERSION__ <= CL_VERSION_1_1
+                    #if __OPENCL_C_VERSION__ < 120
                     #pragma OPENCL EXTENSION cl_khr_fp64: enable
                     #endif
                     #define PYOPENCL_DEFINE_CDOUBLE