inducer / arraycontext

Choose your favorite numpy-workalike!
6 stars 11 forks source link

PyOpenCLArrayContext does not support elementwise functions for scalars #78

Closed kaushikcfd closed 3 years ago

kaushikcfd commented 3 years ago
In [1]: from arraycontext import _acf

In [2]: actx = _acf()

In [3]: actx.np.sin(3.14)

    150             actx = self._array_context
    151             prg = _get_scalar_func_loopy_program(actx,
--> 152                     c_name, nargs=len(args), naxes=len(args[0].shape))
    153             outputs = actx.call_loopy(prg,
    154                     **{"inp%d" % i: arg for i, arg in enumerate(args)})

AttributeError: 'float' object has no attribute 'shape'
inducer commented 3 years ago

I agree that we should support this. Should be an easy patch.