Skip to content
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

next: how to do domain inference for dynamic shift #1676

Open
havogt opened this issue Sep 30, 2024 · 1 comment
Open

next: how to do domain inference for dynamic shift #1676

havogt opened this issue Sep 30, 2024 · 1 comment

Comments

@havogt
Copy link
Contributor

havogt commented Sep 30, 2024

@field_operator
def foo(..., k_offset):
    return compute_k_field(...)(as_offset(Koff, k_offset))

lowers to

return as_fieldop(lambda k_offset, k_field: deref(shift(Koff, deref(k_offset))), out_domain)(k_offset, compute_k_field(...))

How can we compute the domain that is needed for compute_k_field?

a) take the out_domain: probably wrong in some cases (e.g. between k and khalf)
b) take the domain of k_offset (this is the same as a), as the domain of k_offset is taken from out_domain
c) user has to annotate the domain explicitly (either explicit (requires to pass in the domain bounds -> ugly) or relative to a domain or field; both introduce slicing-like syntax and requires clear concept definition)
d) inline everything below for now and find a better way to express the pattern

Note: in icon4py all as_offsets are in the vertical

@havogt
Copy link
Contributor Author

havogt commented Oct 21, 2024

TODO: try if a) works in icon4py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant