Skip to content

Commit e1a5906

Browse files
authored
Prefer atomic_assign(ptr, val) -> atomic_store(ptr, val) (#2383)
We are looking at deprecating atomic_assign() kokkos/kokkos#7449 Use atomic_store() instead. Signed-off-by: Damien L-G <dalg24@gmail.com>
1 parent b052734 commit e1a5906

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

common/unit_test/Test_Common_float128.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,8 @@ void testfloat128() {
131131
}
132132

133133
// Assign to the first entry, atomically.
134-
Kokkos::atomic_assign(&view(0), z);
135-
cout << "view(0) after atomic_assign (z) = " << view(0) << endl;
134+
Kokkos::atomic_store(&view(0), z);
135+
cout << "view(0) after atomic_store (z) = " << view(0) << endl;
136136
if (view(0) != z) {
137137
success = false;
138138
}

sparse/src/KokkosSparse_BsrMatrix.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -967,7 +967,7 @@ class BsrMatrix {
967967
case BsrMatrix::valueOperation::ASSIGN: {
968968
for (ordinal_type lcol = 0; lcol < block_size; ++lcol) {
969969
if (force_atomic) {
970-
Kokkos::atomic_assign(&(local_row_values[lcol]), vals[offset_into_vals + lrow * block_size + lcol]);
970+
Kokkos::atomic_store(&(local_row_values[lcol]), vals[offset_into_vals + lrow * block_size + lcol]);
971971
} else {
972972
local_row_values[lcol] = vals[offset_into_vals + lrow * block_size + lcol];
973973
}

sparse/src/KokkosSparse_CrsMatrix.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -611,7 +611,7 @@ class CrsMatrix {
611611
const ordinal_type offset = findRelOffset(&(row_view.colidx(0)), length, cols[i], hint, is_sorted);
612612
if (offset != length) {
613613
if (force_atomic) {
614-
Kokkos::atomic_assign(&(row_view.value(offset)), vals[i]);
614+
Kokkos::atomic_store(&(row_view.value(offset)), vals[i]);
615615
} else {
616616
row_view.value(offset) = vals[i];
617617
}

0 commit comments

Comments
 (0)