Questions

  1. In simple_element_kernel_example0.py, we don't consider the memory transfers to and from the GPU in measuring the time for the GPU computation. Try measuring the time that the gpuarray functions, to_gpu and get, take with the Python time command. Would you say it's worth offloading this particular function onto the GPU, with the memory transfer times in consideration?

  2. In Chapter 1, Why GPU Programming?, we had a discussion of Amdahl's Law, which gives us some idea of the gains we can potentially get by offloading portions of a program onto a GPU. Name two issues that we have seen in this chapter that Amdahl's law does not take into consideration.

  3. Modify gpu_mandel0.py to use smaller and smaller lattices of complex numbers, ...

Get Hands-On GPU Programming with Python and CUDA now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.