What is the difference between CPU and GPU?

Source: Internet
Author: User

First you need to explain what the two abbreviations for CPU (the processing unit) and the GPU (Graphics processing Unit) represent respectively. CPU is the central processing unit, the GPU is the graphics processor. Second, to explain the difference between the two, first understand the similarities: both have a bus and the outside world, have their own caching system, as well as digital and logical unit of operation. In a word, both are designed to accomplish computational tasks.

First visualize the schematic:

As we can see from the diagram, both the CPU and the GPU have their own storage (the orange part, the actual storage system is more complex than the diagram), the control logic (yellow part) and the Operation unit (green part), but the difference is that the CPU control logic is more complex, while the GPU's computing unit is small but numerous, The GPU can also provide more registers and programs for ape-controllable multilevel storage resources.

The difference between the two is the structure difference between the caching system and the digital logical unit of operation in the slice: Although the CPU has multi-core, but the total number is not more than two digits, each core has large enough cache and enough number and logical unit of operation, and auxiliary have a lot of acceleration branch to judge even more complex logic judgment hardware; The number of cores on the GPU is much more than the CPU, known as the Fermi (NVIDIA has 512 cores). Each kernel has a relatively small cache size and a small number of logical units of operation (the GPU was initially weaker than the CPU on floating-point computations). The result is that the CPU is adept at computing tasks with complex computational steps and complex data dependencies, such as distributed computing, data compression, artificial intelligence, physical simulations, and many other computational tasks.

GPU for historical reasons, is for video games generated (so far its main driving force or the growing video game market), in three-dimensional games often appear in a kind of operation is the same operation of massive data, such as: the same coordinate transformation for each vertex, Calculates the color value for each vertex according to the same illumination model. The GPU's core architecture is ideal for sending the same instruction stream to the core and executing it with different input data. In about 2003-2004 years, field experts outside of graphics began to notice the unique computing power of the GPU and began to try to use the GPU for general-purpose computing (ie, GPGPU). After Nvidia released CUDA,AMD and Apple and other companies also released the OPENCL,GPU began to be widely used in the field of general computing, including: Numerical analysis, mass data processing (sorting, map-reduce, etc.), financial analysis and so on.

In short, when programmers write programs for CPUs, they tend to use complex logical structural optimization algorithms to reduce the computational task's elapsed time, i.e. latency. When programmers write programs for the GPU, they use the advantage of processing massive data to cover up the lantency by increasing the total data throughput (throughput). At present, the difference between CPU and GPU is shrinking, because the GPU has made great strides in dealing with irregular tasks and communication between threads. In addition, the power problem for the GPU is more serious than the CPU.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.