CPU Vs. GPU

Have you ever wondered why our devices have two different types processors namely a GPU(Graphics Processing Unit) and a CPU(Central Processing Unit) when the latter is capable of doing all the processing?

If your answer is Yes then Congratulations, you've come to the right article.
Before going forward let's first know what these two components are.

CPU

The CPU or Central Processing Unit is where all the program instructions are executed in order to derive the necessary data. The advancement in modern day CPUs have allowed it to crunch more numbers than ever before.
Superficially a CPU is a general purpose processor - it can in principle do any computation, but not necessarily in an optimal fashion for any given computation. One can do graphics processing on a CPU - but it likely will not produce the result anywhere nearly as fast as a properly programmed GPU

GPU

graphics processing unit (GPU), occasionally called visual processing unit(VPU), is a specialized electronic circuit designed to rapidly manipulate and alter memory to accelerate the creation of images in a frame buffer intended for output to a display device. GPUs are used in embedded systemsmobile phonespersonal computersworkstations, and game consoles.
 Modern GPUs are very efficient at manipulating computer graphics and image processing, and their highly parallel structure makes them more efficient than general-purpose CPUs for algorithms where the processing of large blocks of data is done in parallel.

So if both the components do the same work, of processing data, then what's the use of having them both?


The reasons one has at least one of each in the typical computer these days is:


Computers that interact directly with people (i.e. not servers) typically use computer graphics extensively to do so, and the calculations involved are numerous and must be done in Real Time.


By having at least one of each, one gains parallel computing & greater performance from throughput of the computer system: while your GPU is doing calculations for graphics, your CPU can be doing other non-graphics calculations at the same time.






Moore's Law has given us such an embarrassment of riches in silicon chip area and capability at such low prices that it's cheap to add special purpose processors of various types nearly everywhere in a computer system these days – often multiple of them, to achieve better throughput & performance.

Okay, So we need both of them for our Computers to work faster and more efficiently, but what's the difference between them?

A GPU generally has a large number of slow and weak processors. Weak meaning lower operating frequency, lower number of registers, simpler ALU's etc. GPU's come strapped with lots of memory and generally have high Memory bandwidth to support  the hundreds of small processors that make up the GPU.


GPUs are special purpose and can compute vector maths, matrix maths, pixel transforms and rendering jobs about 10-100x faster than the equivalent CPU performance as all these tasks are embarrassingly parallel, although it should be noted that incredibly optimized CPU code can come close to GPU code.


However, the amount of work required is not worth the time when GPUs can do the same calculations with significantly less work, and not requiring a programmer with an excellent background in computer architecture.

Now that you know the difference and applications of these two components, you can use the best of both world to get the extreme performance you always wanted.


No comments:

Post a Comment

Intuition and Business

Everyone makes many mistakes in business. But one does not have to beat himself up about them, in fact he has to be greatful to have made th...