- Hands-On GPU Programming with Python and CUDA
- Dr. Brian Tuomanen
- 288字
- 2021-06-10 19:25:34
Summary
The main advantage of using a GPU over a CPU is its increased throughput, which means that we can execute more parallel code simultaneously on GPU than on a CPU; a GPU cannot make recursive algorithms or nonparallelizable algorithms somewhat faster. We see that some tasks, such as the example of building a house, are only partially parallelizable—in this example, we couldn't speed up the process of designing the house (which is intrinsically serial in this case), but we could speed up the process of the construction, by hiring more laborers (which is parallelizable in this case).
We used this analogy to derive Amdahl's Law, which is a formula that can give us a rough estimate of potential speedup for a program if we know the percentage of execution time for code that is parallelizable, and how many processors we will have to run this code. We then applied Amdahl's Law to analyze a small program that generates the Mandelbrot set and dumps it to an image file, and we determined that this would be a good candidate for parallelization onto a GPU. Finally, we ended with a brief overview of profiling code with the cPython module; this allows us to see where the bottlenecks in a program are, without explicitly timing function calls.
Now that we have a few of the fundamental concepts in place, and have a motivator to learn GPU programming, we will spend the next chapter setting up a Linux- or Windows 10-based GPU programming environment. We will then immediately dive into the world of GPU programming in the following chapter, where we will actually write a GPU-based version of the Mandelbrot program that we saw in this chapter.
- Linux網(wǎng)絡(luò)管理與配置(第2版)
- Learning OpenDaylight
- Implementing Cisco UCS Solutions
- Linux從零開始學(xué)(視頻教學(xué)版)
- Instant Handlebars.js
- Linux性能優(yōu)化
- Java EE 8 Design Patterns and Best Practices
- 竹林蹊徑:深入淺出windows驅(qū)動(dòng)開發(fā)
- Microsoft Operations Management Suite Cookbook
- Joomla! 3 Template Essentials
- 注冊(cè)表應(yīng)用完全DIY
- Windows 7應(yīng)用入門與技巧
- RHCSARHCE 紅帽Linux認(rèn)證學(xué)習(xí)指南(第7版)EX200 & EX300
- 寫給架構(gòu)師的Linux實(shí)踐:設(shè)計(jì)并實(shí)現(xiàn)基于Linux的IT解決方案
- 鴻蒙操作系統(tǒng)設(shè)計(jì)原理與架構(gòu)