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] Support for the pre/post increment operator #2967

Closed
anagainaru opened this issue Apr 22, 2020 · 2 comments
Closed

[ScatterView] Support for the pre/post increment operator #2967

anagainaru opened this issue Apr 22, 2020 · 2 comments

Comments

@anagainaru
Copy link

There is currently an inconsistency between View and ScatterView in their support of the pre/post increment operator

@masterleinad
Copy link
Contributor

Do you have an example what is working for you and what is not? Are you referring to

Kokkos::View<int**> v;
Kokkos::View<int*> r
Kokkos::Experimental::ScatterView<int*> results(r);
Kokkos::parallel_for("Atomic Loop", v.extent(0),
  KOKKOS_LAMBDA(const int i) {
  auto access = results.access();
  for(int j=0; j<v.extent(1); j++)
    access(v(i,j))++;
});

not working while

Kokkos::View<int**> v;
Kokkos::View<int*,Kokkos::MemoryTraits<Kokkos::Atomic>> r
Kokkos::parallel_for("Atomic Loop", v.extent(0),
  KOKKOS_LAMBDA(const int i) {
  for(int j=0; j<v.extent(1); j++)
    r(v(i,j))++;
});

does?

@anagainaru
Copy link
Author

@masterleinad That is correct

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

No branches or pull requests

3 participants