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

Deprecate passing unevaluated arrays to compiled functions

parent 8d7c872e
No related branches found
No related tags found
No related merge requests found
Pipeline #303732 passed
......@@ -468,6 +468,14 @@ def _args_to_device_buffers(actx, input_id_to_name_in_program, arg_id_to_arg):
pass
elif isinstance(arg, pt.Array):
# got an array expression => evaluate it
from warnings import warn
warn(f"Argument array '{arg_id}' to a compiled function is "
"unevaluated. Evaluating just-in-time, at "
"considerable expense. This is deprecated and will stop "
"working in 2023. To avoid this warning, force evaluation "
"of all arguments via freeze/thaw.",
DeprecationWarning, stacklevel=4)
arg = actx.freeze(arg)
else:
raise NotImplementedError(type(arg))
......
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