Need suggestions to avoid bank conflicts...

Can someone explain how to avoid bank conflicts in the above code?

  1. don’t forget __syncThreads(); after filling choiceArray, otherwise you might run into some really strange errors later!

  2. how does the second part depend on thread id? Right now it seems every thread is doing the same, accessing the same place in shared memory at the same time, which mean you have no bank conflicts.

Also: initialize a and b and change lenght to length :)