Course


Square an array of numbers

Learn how to square a number set in GPU

How to square a set of two numbers?

In this lesson, we're going to take an input array of 64 floating point numbers, numbered 0 to 63, and we're going to square each number in the array. So the output will be 0, 1, 4, 9, and so on. We're going to do this in three steps.

  1. We're going to start by looking at how we'd run this code on the CPU.
  2. Then we'll talk about how we'd run this on the GPU without looking at code,
  3. Instead just discussing what our code would do. Then we'll dive into what the code actually looks like.

Now let's run the CUDA code

In the following, we run the code from the above video lesson.

CUDA (4.0)
  • Show Input  

Video credit: Udacity