Skip to content
Snippets Groups Projects
Commit deb2a813 authored by Andreas Klöckner's avatar Andreas Klöckner Committed by Andreas Klöckner
Browse files

fake_numpy: use loopy to allocate elementwise function outputs

parent 6e768a98
No related branches found
No related tags found
No related merge requests found
......@@ -148,13 +148,11 @@ class BaseFakeNumpyNamespace:
def __getattr__(self, name):
def loopy_implemented_elwise_func(*args):
actx = self._array_context
# FIXME: Maybe involve loopy type inference?
result = actx.empty(args[0].shape, args[0].dtype)
prg = _get_scalar_func_loopy_program(actx,
c_name, nargs=len(args), naxes=len(args[0].shape))
actx.call_loopy(prg, out=result,
outputs = actx.call_loopy(prg,
**{"inp%d" % i: arg for i, arg in enumerate(args)})
return result
return outputs["out"]
if name in self._c_to_numpy_arc_functions:
from warnings import warn
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment