title: matrix multiplication in cuda
body: <p>say I want to multiply two matrices together, 50 by 50. I have 2 ways to arrange threads and blocks.</p>
  
  <p>a) one thread to calculate each element of the result matrix. So I have a loop in thread multiplies one row and one column.</p>
  
  <p>b) one thread to do each multiplication. Each element of the result matrix requires 50 threads. After multiplications are done, I can use binary reduction to sum the results. </p>
  
  <p>I wasn't sure which way to take, so I took b. It wasn't ideal. In fact it was slow. Any idea why? My guess would be there are just too many threads and they are waiting for resource most of time, is that true?</p>