Skip to content

Commit 3d16e6f

Browse files
committed
Fix data race in fill of associator
1 parent 808bc4c commit 3d16e6f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

include/CLUEstering/DataFormats/alpaka/AssociationMap.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ namespace clue {
7171
uint32_t* sizes,
7272
size_t size) const {
7373
for (auto i : alpaka::uniformElements(acc, size)) {
74-
auto prev = alpaka::atomicAdd(acc, &sizes[associations[i]], 1u);
74+
alpaka::atomicAdd(acc, &sizes[associations[i]], 1u);
7575
}
7676
}
7777
};
@@ -86,8 +86,8 @@ namespace clue {
8686
for (auto i : alpaka::uniformElements(acc, size)) {
8787
const auto binId = bin_buffer[i];
8888
const auto position = temp_offsets[binId];
89-
indexes[position] = i;
90-
alpaka::atomicAdd(acc, &temp_offsets[binId], 1u);
89+
auto prev = alpaka::atomicAdd(acc, &temp_offsets[binId], 1u);
90+
indexes[prev] = i;
9191
}
9292
}
9393
};

0 commit comments

Comments
 (0)