Skip to content

Commit

Permalink
dalse_sharing_1 assignment
Browse files Browse the repository at this point in the history
  • Loading branch information
Oleg Makovski committed Jan 29, 2025
1 parent 28f13c3 commit a62faab
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion labs/memory_bound/false_sharing_1/solution.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ std::size_t solution(const std::vector<uint32_t> &data, int thread_count) {
// Using std::atomic counters to disallow compiler to promote `target`
// memory location into a register. This way we ensure that the store
// to `target` stays inside the loop.
struct Accumulator {
struct alignas(64) Accumulator {
std::atomic<uint32_t> value = 0;
};
std::vector<Accumulator> accumulators(thread_count);
Expand Down

0 comments on commit a62faab

Please sign in to comment.