From fd49dbfc25d1263f0bb620392530dc220a615e33 Mon Sep 17 00:00:00 2001 From: Pierre Paleo Date: Mon, 4 Nov 2024 14:54:34 +0100 Subject: [PATCH] Use self.allocate_texture() in projector --- src/silx/opencl/projection.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/silx/opencl/projection.py b/src/silx/opencl/projection.py index cf4b625cfa..ff5c776965 100644 --- a/src/silx/opencl/projection.py +++ b/src/silx/opencl/projection.py @@ -222,14 +222,8 @@ def allocate_slice(self): self.add_to_cl_mem({"d_slice": ary}) def allocate_textures(self): - self.d_image_tex = pyopencl.Image( - self.ctx, - mf.READ_ONLY | mf.USE_HOST_PTR, - pyopencl.ImageFormat( - pyopencl.channel_order.INTENSITY, pyopencl.channel_type.FLOAT - ), - hostbuf=np.ascontiguousarray(self._tmp_extended_img.T), - ) + hostbuf = np.ascontiguousarray(self._tmp_extended_img.T) + self.d_image_tex = self.allocate_texture(hostbuf.shape, hostbuf) def transfer_to_texture(self, image): image2 = image