Skip to content

Commit

Permalink
Prefer atomic_assign(ptr, val) -> atomic_store(ptr, val) (#2383)
Browse files Browse the repository at this point in the history
We are looking at deprecating atomic_assign() kokkos/kokkos#7449
Use atomic_store() instead.

Signed-off-by: Damien L-G <[email protected]>
  • Loading branch information
dalg24 authored Oct 16, 2024
1 parent b052734 commit e1a5906
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions common/unit_test/Test_Common_float128.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,8 @@ void testfloat128() {
}

// Assign to the first entry, atomically.
Kokkos::atomic_assign(&view(0), z);
cout << "view(0) after atomic_assign (z) = " << view(0) << endl;
Kokkos::atomic_store(&view(0), z);
cout << "view(0) after atomic_store (z) = " << view(0) << endl;
if (view(0) != z) {
success = false;
}
Expand Down
2 changes: 1 addition & 1 deletion sparse/src/KokkosSparse_BsrMatrix.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -967,7 +967,7 @@ class BsrMatrix {
case BsrMatrix::valueOperation::ASSIGN: {
for (ordinal_type lcol = 0; lcol < block_size; ++lcol) {
if (force_atomic) {
Kokkos::atomic_assign(&(local_row_values[lcol]), vals[offset_into_vals + lrow * block_size + lcol]);
Kokkos::atomic_store(&(local_row_values[lcol]), vals[offset_into_vals + lrow * block_size + lcol]);
} else {
local_row_values[lcol] = vals[offset_into_vals + lrow * block_size + lcol];
}
Expand Down
2 changes: 1 addition & 1 deletion sparse/src/KokkosSparse_CrsMatrix.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -611,7 +611,7 @@ class CrsMatrix {
const ordinal_type offset = findRelOffset(&(row_view.colidx(0)), length, cols[i], hint, is_sorted);
if (offset != length) {
if (force_atomic) {
Kokkos::atomic_assign(&(row_view.value(offset)), vals[i]);
Kokkos::atomic_store(&(row_view.value(offset)), vals[i]);
} else {
row_view.value(offset) = vals[i];
}
Expand Down

0 comments on commit e1a5906

Please sign in to comment.