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

Hotfixes psy2dawn #1157

Open
wants to merge 25 commits into
base: master
Choose a base branch
from

Conversation

mroethlin
Copy link
Contributor

@mroethlin mroethlin commented Dec 10, 2021

Technical Description

This PR contains some hot fixes for the Psy2Dawn Project. This should probably be 3 PRs but since this project is EOL I deemed it acceptable to have a summary PR for this

Resolves / Enhances

  • Add sign function to the toolchain
  • Make the checkOffset function in generated code static for easier linking of multiple stencils into one library
  • Fix the code generation for iteration spaces on the cuda backend to use the physical address when checking against the offset instead of the index in the block. Note that this is only tested for the situation where GRIDTOOLS_DAWN_HALO_EXTENT=0
  • Fix an issue where, in the cuda backend, checks would be emitted for all iteration spaces in the stencil, not only the iteration spaces associated with a given stage
  • Fix an issue if a MS is generated that only uses a temp field. In that case, no strides would be generated, effectively only iterating over one column of the temp field.

Example

A simple iteration space

    iteration_space(i_start + 1, i_end-1, j_start + 1, j_end - 1, k_start + 1, k_end - 1) {
      out = 1;
    }

would lead to false positive testing against the iteration space along the j domain in a test case found during the psy2dawn deliverable.

In the cuda backend, a sequence like

    iteration_space(i_start + 1, i_end-1, j_start + 1, j_end - 1, k_start + 1, k_end - 1) {
      out = 1;
    }

    iteration_space(j_start + 1, j_end - 1, k_start + 1, k_end - 1) {
      out = 2;
    }

would be spuriously compiled to the equivalent of

    iteration_space(i_start + 1, i_end-1, j_start + 1, j_end - 1, k_start + 1, k_end - 1) {
      out = 1;
    }

    iteration_space(j_start + 1, j_end - 1, j_start + 1, j_end - 1, k_start + 1, k_end - 1) {
      out = 2;
    }

Testing

  • Three new tests were added to the code generation tests of gtclang
  • A test had to be adapted to the new codegen

Dependencies

This PR is independent.

@mroethlin
Copy link
Contributor Author

launch jenkins

1 similar comment
@mroethlin
Copy link
Contributor Author

launch jenkins

@mroethlin mroethlin marked this pull request as draft December 13, 2021 10:06
@mroethlin
Copy link
Contributor Author

launch jenkins

@mroethlin mroethlin marked this pull request as ready for review December 13, 2021 11:33
@mroethlin
Copy link
Contributor Author

launch jenkins

@mroethlin
Copy link
Contributor Author

launch jenkins

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.

None yet

1 participant