From 3a96299f0e60248aa11261646d82155c0c6bbd89 Mon Sep 17 00:00:00 2001
From: Matthias Diener <mdiener@illinois.edu>
Date: Mon, 8 Aug 2022 19:40:39 -0500
Subject: [PATCH] hstack: fix allocator

---
 pyopencl/array.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/pyopencl/array.py b/pyopencl/array.py
index b96c2a50..15ed2bbb 100644
--- a/pyopencl/array.py
+++ b/pyopencl/array.py
@@ -2749,7 +2749,8 @@ def hstack(arrays, queue=None):
                  "an instance of the type of arrays[0]",
                  stacklevel=2)
 
-    result = arrays[0].__class__(queue, lead_shape+(w,), arrays[0].dtype)
+    result = arrays[0].__class__(queue, lead_shape+(w,), arrays[0].dtype,
+                                 allocator=arrays[0].allocator)
     index = 0
     for ary in arrays:
         result[..., index:index+ary.shape[-1]] = ary
-- 
GitLab