Open main menu

CDOT Wiki β

Changes

GPU621/Analyzing False Sharing

423 bytes added, 10:52, 23 November 2022
Example Of A False Sharing
The main purpose of the sumUp function is to calculate the sum of odd elements or even elements based on the data in the first vector argument in the argument list. Also, the sum will be recorded in the corresponding position of the second vector argument using the int argument as the index.
Which block of code do you feel think will take less time?
Theoretically , this code should be executed faster on a multicore machine it should be with a Thread block than a serial block. But the result is. Or this To our surprise, the Thread code serial block that is fastermuch less time-consuming. This turns our existing knowledge upside down, but don't worry, it's because you haven't understood False Sharing yet. As we said above, right? But the result smallest unit of CPU operation on the cache is the size of a cache line, which is 64 bytes. As you can see in our program code, sum isa vector that stores 2 consecutive long data types.
118
edits