Open main menu

CDOT Wiki β

Changes

GPU621/Analyzing False Sharing

209 bytes added, 16:22, 24 November 2022
no edit summary
g++ -std=c++11 -pthread -O2 false_sharing.cpp
 
Output('''with''' byte alignment):
 
[[File:with1.jpg|400px]]<br />
 
[[File:with2.jpg|400px]]<br />
 
Output('''without''' byte alignment):
 
[[File:without1.jpg|400px]]<br />
 
[[File:without2.jpg|400px]]<br />
After running it, I found that the difference between the runtime with and without byte alignment is very small and there is no instability, the runtime is around 200ms.
But the unexpected thing is that when I execute increment1() and increment2() in serial code only, it only consumes 53ms!
118
edits