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

ScatterView LayoutLeft overload currently non-functional #2165

Closed
AndrewGaspar opened this issue Jun 3, 2019 · 2 comments
Closed

ScatterView LayoutLeft overload currently non-functional #2165

AndrewGaspar opened this issue Jun 3, 2019 · 2 comments
Assignees
Labels
Bug Broken / incorrect code; it could be Kokkos' responsibility, or others’ (e.g., Trilinos)

Comments

@AndrewGaspar
Copy link
Contributor

The ScatterView constructor for the LayoutLeft variant passes 0 as rank 7 dimension, which makes the View constructor think there's one more dimension than there actually is.

  template <typename RT, typename ... RP >
  ScatterView(View<RT, RP...> const& original_view)
  : unique_token()
  {
    size_t arg_N[8] = {
      original_view.extent(0),
      original_view.extent(1),
      original_view.extent(2),
      original_view.extent(3),
      original_view.extent(4),
      original_view.extent(5),
      original_view.extent(6),
      0
    };
    arg_N[internal_view_type::rank - 1] = unique_token.size();
    internal_view = internal_view_type(
        Kokkos::ViewAllocateWithoutInitializing(
          std::string("duplicated_") + original_view.label()),
        arg_N[0], arg_N[1], arg_N[2], arg_N[3],
        arg_N[4], arg_N[5], arg_N[6], arg_N[7]);
    reset();
  }

Look at the LayoutRight variant for the correct way to do this. Rather than 0, it must be KOKKOS_IMPL_CTOR_DEFAULT_ARG.

@crtrott crtrott added Blocks Promotion Overview issue for release-blocking bugs Bug Broken / incorrect code; it could be Kokkos' responsibility, or others’ (e.g., Trilinos) labels Jun 3, 2019
@crtrott crtrott self-assigned this Jun 5, 2019
@crtrott
Copy link
Member

crtrott commented Jun 5, 2019

Looks like this error only triggers in debug mode.

crtrott added a commit that referenced this issue Jun 5, 2019
crtrott added a commit that referenced this issue Jun 5, 2019
@crtrott
Copy link
Member

crtrott commented Jun 5, 2019

#2169 fixes this.

@crtrott crtrott added bug - fix pushed to develop branch and removed Blocks Promotion Overview issue for release-blocking bugs labels Jun 5, 2019
dhollman pushed a commit that referenced this issue Jun 11, 2019
dhollman pushed a commit that referenced this issue Jun 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Broken / incorrect code; it could be Kokkos' responsibility, or others’ (e.g., Trilinos)
Projects
None yet
Development

No branches or pull requests

3 participants