inducer / arraycontext

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

Add astype to PyOpenCLArrayContext #114

Closed alexfikl closed 3 years ago

alexfikl commented 3 years ago

Managed to find a use for this in pytential. When unflattening an array, went with

template_ary = discr.nodes()[0]
ary = unflatten(template_ary, ary, actx)

to replace

ary = unflatten(actx, discr, ary)

but this doesn't work when ary is complex, which happens for e.g. Helmholtz.

Maybe it's worth adding a strict=True to unflatten to skip checking types and strides?