YouTube

Got a YouTube account?

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

English subtitles

← What the GPU Is Good At - Intro to Parallel Programming

Get Embed Code
4 Languages

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

  1. We've presented at a high level what the programming model looks like.
  2. Now what you need to know is what is the GPU good at?
  3. How is it going to be good at running programs I write in this programming model?
  4. So what is the GPU good at?
  5. For now, let me just tell you two things.
  6. Keep these in mind as you're planning your program.
  7. Thing number one: it is really good at efficiently launching lots of threads.
  8. You may be used to other programming environments where launching threads is an expensive process.
  9. That is not the case here.
  10. In fact, as we'll discuss later, if you're not launching lots of threads, you're not using the GPU effectively.
  11. Dave, my co-instructor, likes to say that the GPU doesn't even
  12. get out of bed in the morning for fewer than a 1000 threads.
  13. The second thing that a GPU is good at is actually running
  14. lots of those threads in parallel all at the same time.
  15. Now we're going to consider a simple example.
  16. We're going to take an input array of 64 floating point numbers, numbered 0 to 63,
  17. and we're going to square each number in the array.
  18. So the output will be 0, 1, 4, 9, and so on.
  19. We're going to do this in three steps.
  20. We're going to start by looking at how we'd run this code on the CPU.
  21. Then we'll talk about how we'd run this on the GPU without looking at code,
  22. instead just discussing what our code would do.
  23. Then we'll dive into what the code actually looks like.