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

feat[next]: itir.embedded support for Lists in output #1703

Open
wants to merge 14 commits into
base: main
Choose a base branch
from

Conversation

havogt
Copy link
Contributor

@havogt havogt commented Oct 22, 2024

Lists returned from an as_fieldoped stencil will be turned into a local dimension of the the resulting field.
In case of a make_const_list, a magic local dimension _CONST_DIM is used. This is a hack, but localized to itir.embedded. A clean implementation will probably involve to tag the make_const_list with the neighborhood it is meant to be used with.

@@ -116,7 +116,31 @@ def visit_FieldOperator(
def visit_ScanOperator(
self, node: foast.ScanOperator, **kwargs: Any
) -> itir.FunctionDefinition:
raise NotImplementedError("TODO")
# note: we don't need the axis here as this is handled by the program
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

copied from itir

@@ -920,9 +936,9 @@ def deref(self) -> Any:
return _make_tuple(self.field, position, column_axis=self.column_axis)


def _get_sparse_dimensions(axes: Sequence[common.Dimension]) -> list[Tag]:
def _get_sparse_dimensions(axes: Sequence[common.Dimension]) -> list[common.Dimension]:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just a cleanup

@havogt
Copy link
Contributor Author

havogt commented Oct 24, 2024

ready for a first round of review

@havogt havogt marked this pull request as ready for review October 24, 2024 19:19
Copy link
Contributor

@tehrengruber tehrengruber left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As discussed I skipped over the details of the embedded implementation.

src/gt4py/next/iterator/transforms/pass_manager.py Outdated Show resolved Hide resolved
@@ -0,0 +1,95 @@
# GT4Py - GridTools Framework
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe a skipped test for the case we don't support yet makes sense: if(..., const_list_val, list_val)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

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

Successfully merging this pull request may close these issues.

2 participants