diff --git a/src/wrap_constants.cpp b/src/wrap_constants.cpp
index 5f3e4324e9bd84039d7f5a4e668f2cbf02ee9510..0b6653c56a564b291a7edd35bbb31edc16a7eedc 100644
--- a/src/wrap_constants.cpp
+++ b/src/wrap_constants.cpp
@@ -480,10 +480,6 @@ void pyopencl_expose_constants(py::module &m)
     ADD_ATTR(DEVICE_, IL_VERSION);
     ADD_ATTR(DEVICE_, MAX_NUM_SUB_GROUPS);
     ADD_ATTR(DEVICE_, SUB_GROUP_INDEPENDENT_FORWARD_PROGRESS);
-#endif
-    /* cl_intel_advanced_motion_estimation */
-#ifdef CL_DEVICE_ME_VERSION_INTEL
-    ADD_ATTR(DEVICE_, ME_VERSION_INTEL);
 #endif
 #if PYOPENCL_CL_VERSION >= 0x3000
     ADD_ATTR(DEVICE_, NUMERIC_VERSION);
@@ -501,6 +497,10 @@ void pyopencl_expose_constants(py::module &m)
     ADD_ATTR(DEVICE_, DEVICE_ENQUEUE_SUPPORT);
     ADD_ATTR(DEVICE_, PIPE_SUPPORT);
 #endif
+    /* cl_intel_advanced_motion_estimation */
+#ifdef CL_DEVICE_ME_VERSION_INTEL
+    ADD_ATTR(DEVICE_, ME_VERSION_INTEL);
+#endif
 
     /* cl_qcom_ext_host_ptr */
 #ifdef CL_DEVICE_EXT_MEM_PADDING_IN_BYTES_QCOM