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

Include center #66

Merged
merged 10 commits into from
Jan 18, 2021
Merged

Include center #66

merged 10 commits into from
Jan 18, 2021

Conversation

mroethlin
Copy link
Contributor

@mroethlin mroethlin commented Dec 16, 2020

Technical Description

This PR introduces support for reductions including the center. Besides the matching and transpilation to SIR checks were added to ensure that the Offsets are consistent with the current iteration space also regarding the inclusion of the center

Resolves

Fixes #66

Example

Fill including the center

@stencil
def fill_with_center(
    sparse: Field[Origin + Edge > Cell > Edge],
    edge: Field[Edge],
):
    with levels_downward:
        with sparse[Origin + Edge > Cell > Edge]:
            sparse = edge[Origin + Edge > Cell > Edge]

Reduction including the center

@stencil
def reductions_with_center(
    a: Field[Edge], b: Field[Origin + Edge > Cell > Edge], c: Field[Edge]
):
    with levels_downward:
        a = sum_over(Origin + Edge > Cell > Edge, b*c[Origin + Edge > Cell > Edge])

Testing

Two tests representing the examples above were introduced

Dependencies

Depends on dawn PR 1081

@mroethlin mroethlin requested a review from BenWeber42 December 16, 2020 16:37
@mroethlin mroethlin marked this pull request as ready for review December 17, 2020 10:45
Copy link
Contributor

@BenWeber42 BenWeber42 left a comment

Choose a reason for hiding this comment

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

We'll do the PR feedback in a pair programming session.

dusk/grammar.py Outdated Show resolved Hide resolved
dusk/grammar.py Outdated Show resolved Hide resolved
dusk/grammar.py Outdated Show resolved Hide resolved
dusk/grammar.py Outdated Show resolved Hide resolved
dusk/grammar.py Outdated Show resolved Hide resolved
dusk/grammar.py Outdated Show resolved Hide resolved
dusk/script/stubs.py Outdated Show resolved Hide resolved
dusk/semantics.py Show resolved Hide resolved
dusk/semantics.py Outdated Show resolved Hide resolved
tests/stencils/test_sparse_fill.py Outdated Show resolved Hide resolved
@BenWeber42 BenWeber42 merged commit d6bbfaf into dawn-ico:master Jan 18, 2021
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.

Support neighbor iterations including the origin/center
2 participants