Can someone explain how to avoid bank conflicts in the above code?
don’t forget __syncThreads(); after filling choiceArray, otherwise you might run into some really strange errors later!
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 :)