Previous | Next --- Slide 19 of 79
Back to Lecture Thumbnails
RX

What is a stream here, A queue?

What is the physical representation of the stream, a (graphic?) memory buffer?

Will the stream structure be different for different stages of the pipelines?

a

Here's my interpretation: A stream is an abstract data structure (like 15-150/210 sequences) which helps enforce data independence. We operate on streams by using kernels (small programs) on them. Kernels are limited in the way they operate on streams to help ensure data independence:

  • A kernel cannot write to its input stream.
  • A kernel can only write to one location in its output stream.
  • A kernel can only read to (and not write to) global memory.
  • More

(Aside: This feels a lot like mapping a function onto a sequence to me).

By imposing these restrictions on kernels, we ensure data independence, and the compiler (CUDA compiler) + hardware (GPU) are able to easily parallelize stream processing.

In practice, streams are arrays in memory (you can see how they're indexed into in the lecture's CUDA code). So I guess one could say streams are just special arrays for GPUs.

kayvonf

@a. I like this comment a lot.

Streams are indeed logical collections. However, there's a difference between a stream and an array. Streams are not necessarily backed by memory. For example, look at this optimization that I performed on a stream program in a prior lecture. There's definitely a logical sequence between foo and bar kernels, but it is never actually realized as an array.

narainsk

We discussed in lecture that GPUs were first created solely for graphics applications. When GPUs were first released, was the actual hardware unable to run other applications or was there simply no support for non-graphics programming? In other words, what was the factor that limited GPU usage across multiple application domains?

kayvonf

@narainsk. It was definitely the capability of the hardware. The first GPUs were not even application-programmable. They executed a fixed set of operations defined by graphics APIs.