Shared memory bank conflict

I think there are banks conflict in my code but I can’t say where…

I see shared memory as an array of 16 rows, each blocks hold a row :

shared_temp[( offset)*16 + lineNumber ]

(with lineNumber = thid%16 and offset is a position on a line).

Each threads will access only to one line. There is 16 lines, so each threads within a wrap reach only one bank.

When I tune my code in order to be sure that there is no conflicts (for example, all threads reach the same memory address), I get a high seed-up.

Where is the problem ?



You can use bank checker macro (part of cutil) if you compile and run in emulation mode. It’ll tell you where in your code you’re getting bank conflicts.





May I ask for details on how to do this? Thanks!

Maybe you can refer to the sample code in the project called"matrixMul",in which the Bank conflict check was used .

just search for CUT_BANK_CHECKER in the SDK, there are a few examples using it.