-
Notifications
You must be signed in to change notification settings - Fork 53
feat[next]: Check inout field #2182
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
This is actually an interesting observation: it it find a problem before tmp creation, but not after the program is actually ok, but only because we did optimization in a way that makes it correct. That mean for gtfn, we could warn before tmp creation and say: "You are violating ..., but if there is no error later, your program will working for now, but may break any time." and then check again after tmp creation with a hard error. Not sure if DaCe checks for race conditions when fusing currently, but if they do, we could also in that case only warn. I am not sure if I like it, but it's something to discuss. |
| def extract_subexprs(expr): | ||
| """Return a list of all subexpressions in expr.args, including expr itself.""" | ||
| subexprs = [expr] | ||
| if hasattr(expr, "args"): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What cases are these?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
make_tuple, tuple_get and all functions like plus, maximum, ...
I am checking for FunCall now.
| @@ -0,0 +1,338 @@ | |||
| # GT4Py - GridTools Framework | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without reading the tests, these cases come up to my mind:
{a, b} <- {as_fieldop(...), as_fieldop(...)}
{a, b} <- as_fieldop(...)
a[0] <- as_fieldop(...)
a[0] <- {as_fieldop(...), as_fieldop(...)}
{a[0], a[1]} <- as_fieldop(...)
{a[0], a[1]} <- {as_fieldop(...), as_fieldop(...)}
a <- {as_fieldop(...), as_fieldop(...)}
…or is_tuple_expr_of
This new pass checks within a
SetAtif any fields that are written are also read with an offset and raises a ValueError in case.It should run before
create_global_tmps, since the shifts of the temporary targets are not forwarded.Motivation: Warn user if he uses an in-out field
TODOs: