From 1a610b6e63dae6b447a1451605230199d75f3edb Mon Sep 17 00:00:00 2001
From: Andreas Kloeckner <inform@tiker.net>
Date: Tue, 12 Mar 2019 16:00:41 -0500
Subject: [PATCH] Test, fix clEnqueueCopyBufferRect wrapper (closes #281 on
 github)

---
 src/wrap_cl.hpp      |  8 ++++----
 test/test_wrapper.py | 11 +++++++++++
 2 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/src/wrap_cl.hpp b/src/wrap_cl.hpp
index 4892e915..ae59fa25 100644
--- a/src/wrap_cl.hpp
+++ b/src/wrap_cl.hpp
@@ -2404,8 +2404,8 @@ namespace pyopencl
       py::object py_buffer_origin,
       py::object py_host_origin,
       py::object py_region,
-      py::sequence py_buffer_pitches,
-      py::sequence py_host_pitches,
+      py::object py_buffer_pitches,
+      py::object py_host_pitches,
       py::object py_wait_for,
       bool is_blocking
       )
@@ -2459,8 +2459,8 @@ namespace pyopencl
       py::object py_src_origin,
       py::object py_dst_origin,
       py::object py_region,
-      py::sequence py_src_pitches,
-      py::sequence py_dst_pitches,
+      py::object py_src_pitches,
+      py::object py_dst_pitches,
       py::object py_wait_for)
   {
     PYOPENCL_PARSE_WAIT_FOR;
diff --git a/test/test_wrapper.py b/test/test_wrapper.py
index 9776b032..17100535 100644
--- a/test/test_wrapper.py
+++ b/test/test_wrapper.py
@@ -1086,6 +1086,17 @@ def test_compile_link(ctx_factory):
     queue.finish()
 
 
+def test_copy_buffer_rect(ctx_factory):
+    ctx = ctx_factory()
+    queue = cl.CommandQueue(ctx)
+
+    arr1 = parray.zeros(queue, (2, 3), "f")
+    arr2 = parray.zeros(queue, (4, 5), "f")
+    arr1.fill(1)
+    cl.enqueue_copy(queue, arr2.data, arr1.data, src_origin=(0, 0), dst_origin=(1, 1),
+            region=arr1.shape[::-1])
+
+
 if __name__ == "__main__":
     # make sure that import failures get reported, instead of skipping the tests.
     import pyopencl  # noqa
-- 
GitLab