From f4ab412a39a07e8625324e02911d627e64c7c886 Mon Sep 17 00:00:00 2001
From: Andreas Kloeckner <inform@tiker.net>
Date: Wed, 16 Sep 2020 15:36:57 -0500
Subject: [PATCH] Add cl.pipe_properties

---
 doc/make_constants.py  | 5 +++++
 pyopencl/__init__.py   | 1 +
 src/wrap_constants.cpp | 9 +++++++++
 3 files changed, 15 insertions(+)

diff --git a/doc/make_constants.py b/doc/make_constants.py
index 5f6f820b..d2c7a42b 100644
--- a/doc/make_constants.py
+++ b/doc/make_constants.py
@@ -320,6 +320,11 @@ const_ext_lookup = {
             "PROPERTIES": cl_30,
             },
 
+        cl.pipe_properties: {
+            "PACKET_SIZE": ("CL_2.0", "2020.3"),
+            "MAX_PACKETS": ("CL_2.0", "2020.3"),
+            },
+
         cl.map_flags: {
             "WRITE_INVALIDATE_REGION": cl_12,
             },
diff --git a/pyopencl/__init__.py b/pyopencl/__init__.py
index 4994391b..0f4709d1 100644
--- a/pyopencl/__init__.py
+++ b/pyopencl/__init__.py
@@ -81,6 +81,7 @@ from pyopencl._cl import (  # noqa: F401
         mem_info,
         image_info,
         pipe_info,
+        pipe_properties,
         addressing_mode,
         filter_mode,
         sampler_info,
diff --git a/src/wrap_constants.cpp b/src/wrap_constants.cpp
index 57d435cd..e816b677 100644
--- a/src/wrap_constants.cpp
+++ b/src/wrap_constants.cpp
@@ -60,6 +60,7 @@ namespace
   class mem_info { };
   class image_info { };
   class pipe_info { };
+  class pipe_properties { };
   class addressing_mode { };
   class filter_mode { };
   class sampler_info { };
@@ -818,6 +819,14 @@ void pyopencl_expose_constants(py::module &m)
     ADD_ATTR(PIPE_, PROPERTIES);
 #endif
   }
+
+  {
+    py::class_<pipe_info> cls(m, "pipe_properties");
+#if PYOPENCL_CL_VERSION >= 0x2000
+    ADD_ATTR(PIPE_, PACKET_SIZE);
+    ADD_ATTR(PIPE_, MAX_PACKETS);
+#endif
+  }
   {
     py::class_<addressing_mode> cls(m, "addressing_mode");
     ADD_ATTR(ADDRESS_, NONE);
-- 
GitLab