I have an array alpha
32 located in shared memory, so it is very easy to create Bank Conflicts I think if I use Lock, when I reach alpha
, then the result will not be in the bank's fraud, is that right?
__ shared {int} alpha [32]; Bull lock = true; While (lock) {if (0 == atomicCAS (mutes, 0, 1)) {int alpValue = alpha [indexalpha]; // indexbox is calculated if (alp value> gt) {atom isch (& amp; alpha [indexoffa], dist); } Atomic (Mutex, 0); Lock = false; }}
PS: Can I use per block lock?
Bank conflict is a shared memory addressing problem. The way hardware is related to them, a warp is likewise There is serial access to the same bank within. It will not be better than the hardware solution by using the mute x / lock, and can only be less efficient.
If there is some misunderstanding here, then I want to show that the situation of a race in the opposition against the bank does not automatically arise. They are connected to the limitations of hardware, and this is not the only effective performance, right.
No comments:
Post a Comment