We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
The following code doesn't work:
#include <cstdio> #include <Kokkos_Core.hpp> int main(int argc, char* argv[]) { Kokkos::initialize(); typedef Kokkos::View<unsigned int, Kokkos::OpenMP, Kokkos::MemoryTraits<Kokkos::Atomic> > AtomicScalar; AtomicScalar atomicScalar("atomicScalar"); const unsigned int numberOfTasks = 1000; Kokkos::parallel_for(Kokkos::RangePolicy<Kokkos::OpenMP>(0, numberOfTasks), KOKKOS_LAMBDA (const unsigned int i) { ++atomicScalar(); }); const unsigned int value = atomicScalar(); printf("scalar is %u, should be %u\n", value, numberOfTasks); Kokkos::finalize(); return 0; }
It does work when replacing atomicScalar with a 1D view of length 1.
The text was updated successfully, but these errors were encountered:
Fixing atomics for scalar views
05c5ddd
This addresses issue #69
Pushed to master.
Sorry, something went wrong.
crtrott
No branches or pull requests
The following code doesn't work:
It does work when replacing atomicScalar with a 1D view of length 1.
The text was updated successfully, but these errors were encountered: