inducer / pyopencl

OpenCL integration for Python, plus shiny features
http://mathema.tician.de/software/pyopencl
Other
1.05k stars 241 forks source link

[cl.array] Prefer input arrays' constructor instead of cla.Array to instantiate the output #531

Closed kaushikcfd closed 2 years ago

kaushikcfd commented 2 years ago

need at least one array to concatenate

import pyopencl.array as cla cla.hstack([]) Traceback (most recent call last): File "", line 1, in File "/home/kgk2/projects/ceesd/pyopencl/pyopencl/array.py", line 2700, in hstack return empty(queue, (), dtype=np.float64) File "/home/kgk2/projects/ceesd/pyopencl/pyopencl/array.py", line 580, in init self.base_data = cl.Buffer( TypeError: init(): incompatible constructor arguments. The following argument types are supported:

  1. pyopencl._cl.Buffer(context: pyopencl._cl.Context, flags: int, size: int = 0, hostbuf: object = None)

Invoked with: None, 1, 8

init(): incompatible constructor arguments. The following argument types are supported:

  1. pyopencl._cl.Buffer(context: pyopencl._cl.Context, flags: int, size: int = 0, hostbuf: object = None)

Invoked with: None, 1, 8

inducer commented 2 years ago

LGTM, thanks!

inducer commented 2 years ago

https://pypi.org/project/pyopencl/2021.2.12/, should wind its way to conda soon.