Closed kaushikcfd closed 3 years ago
On main, the following (buggy) behavior is seen:
main
$ cat fail_pyopencl_arith.py from dataclasses import dataclass import numpy as np import pyopencl as cl import pyopencl.array as cla ctx = cl.create_some_context() cq = cl.CommandQueue(ctx) @dataclass class ArrayContainer: _data: np.ndarray def __eq__(self, other): return ArrayContainer(self._data == other) print(ArrayContainer(np.ones(100)) + cla.zeros(cq, (10,), dtype=np.float64)) $ python fail_pyopencl_arith.py [0. 0. 0. 0. 0. 0. 0. 0. 0. 0.]
Yikes, this is bad. Thanks for catching and fixing this. I'll roll a release to avoid other folks being bitten by it.
436a5cbd2e25c5ef0eff610df0a13a7a18803f45 / https://pypi.org/project/pyopencl/2021.2.4/
On
main
, the following (buggy) behavior is seen: