Got a YouTube account?

New: enable viewer-created translations and captions on your YouTube channel!

English subtitles

← Role of thread in SpMv - Intro to Parallel Programming

Get Embed Code
2 Languages

Showing Revision 4 created 05/25/2016 by Udacity Robot.

  1. So which approach will launch more threads: Thread per row, thread per element?
  2. The answer is thread per element.
  3. Thread per element will launch a thread for every X in this matrix,
  4. but thread per row, on the other hand, will only launch a thread for every row in this matrix.
  5. So thread per element will certainly have at least as many, if not many more threads than thread per row.
  6. Which approach will require communication between threads?
  7. Well, that's also going to be thread per element.
  8. What's going to happen there is
  9. we compute a partial product for each element in a particular row
  10. and then we need to add up those partial products across those elements to create the final value.
  11. And if you remember we use the segmented scan operation to be able to do that in Unit 4.
  12. The final question, which approach will do more work per thread?
  13. Well that's going to be thread per row.
  14. This row has to do all the partial products and add them up,
  15. whereas thread per element only does 1 partial product per element
  16. and then combines the work across multiple threads to be able to get a final result.