CUDA for Engineers: An Introduction to High-Performance Parallel Computing
by Mete Yurtoglu, Duane Storti
Chapter 2. CUDA Essentials
Our discussion in Chapter 1, “First Steps,” left off with the function distanceArray(), which computes distance values from a reference point to an array of input locations. The computation is completely serial; the values are computed in a sequence as the index i in a for loop increments over the range of input array elements. However, the computation of any one of the distance values is independent of the other computations. In a serial implementation, we do not take advantage of the independence and instead wait until one entry in the array is computed before moving on to the next. There is no particular downside to the serial approach if you are using a simple system that can only do one computation at a time. However, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access