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

Bug in field versioning (in vertical reduction pattern) #87

Open
cosunae opened this issue May 11, 2018 · 2 comments
Open

Bug in field versioning (in vertical reduction pattern) #87

cosunae opened this issue May 11, 2018 · 2 comments
Labels
backend dawn related bug

Comments

@cosunae
Copy link
Contributor

cosunae commented May 11, 2018

The following example will do versioning of tmp, which will lead to wrong result

stencil stencil {
  storage a, tmp, c;

  Do {
    vertical_region(k_end, k_end)
      tmp=0;

    vertical_region(k_end-1, k_start) {
      a = tmp[k+1];
      tmp = a;
      c = tmp;
    }
  }
};
    struct stage_0_0 {
      using c = gridtools::accessor<0, gridtools::enumtype::inout, gridtools::extent<0, 0, 0, 0, 0, 0>>;
      using tmp = gridtools::accessor<1, gridtools::enumtype::inout, gridtools::extent<0, 0, 0, 0, 0, 0>>;
      using a = gridtools::accessor<2, gridtools::enumtype::inout, gridtools::extent<0, 0, 0, 0, 0, 0>>;
      using tmp_1 = gridtools::accessor<3, gridtools::enumtype::inout, gridtools::extent<0, 0, 0, 0, 0, 1>>;
      using arg_list = boost::mpl::vector<c, tmp, a, tmp_1>;

      template <typename Evaluation>
      GT_FUNCTION static void Do(Evaluation& eval, interval_end_0_end_0) {
        eval(tmp_1(0, 0, 0)) = (int)0;
      }

      template <typename Evaluation>
      GT_FUNCTION static void Do(Evaluation& eval, interval_start_0_end_minus_1) {
        eval(a(0, 0, 0)) = eval(tmp_1(0, 0, 1));
        eval(tmp(0, 0, 0)) = eval(a(0, 0, 0));
        eval(c(0, 0, 0)) = eval(tmp(0, 0, 0));
      }
    };

I guess tmp should not be versioned in this case

@cosunae cosunae added the bug label May 11, 2018
@cosunae
Copy link
Contributor Author

cosunae commented May 11, 2018

It is somehow working if a is declared locally as a double

havogt pushed a commit to havogt/dawn that referenced this issue Oct 3, 2019
@mroethlin
Copy link
Contributor

This is still open as of 17.10.2019 / master: a8ded67, i.e. is still versioned: PASS: PassFieldVersioning: stencil: rename:13 tmp:tmp_0

@mroethlin mroethlin added the backend dawn related label Oct 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend dawn related bug
Projects
None yet
Development

No branches or pull requests

2 participants