what is the fundamental difference between CPU and GPU when both of them do some calculations ?

358 views

what is the fundamental difference between CPU and GPU when both of them do some calculations ?

In: 2

8 Answers

Anonymous 0 Comments

CPU is for running the stuff you look at and click stuff in to open games and apps. Think like the cars and roads that take you to the racetrack.

GPU is more like a racecar. There’s lots of stuff it’s no good at, but the stuff it can do it does better than anything else can do it.

Anonymous 0 Comments

GPUs have specialized hardware, because they are doing *a whole lot* of *the same* calculations. (Specifically, they’re optimized for things like matrix multiplication, since that comes up a *lot* in graphics.) They also tend to have more, slower cores, because many graphics calculations don’t have to be done in order – you can compute basically every pixel in an image almost totally in parallel (and if you can do things in parallel, 2 1GHz processors are better than 1 1.5GHz processor).

CPUs are general purpose, and they usually deal with calculations that have to be done at least partly in order. So they tend to have relatively few cores, and those cores are designed to handle a wide range of calculations.

Anonymous 0 Comments

On the hardware end,

CPUs can handle complex instructions but have only few cores, around 16 or so.

GPUs can handle simple instructions but thousands of cores.

Each core can handle one “calculation” at a time (ignoring pipelining). Having more cores means more parallel computing.

Anonymous 0 Comments

There is no hard line fundamental difference, they are the same basic thing: a processor. A gpu generally is set up to do more of the same thing at once and a cpu is more around doing lots of different things in a row, but they are basically the same general technology

Anonymous 0 Comments

The CPU has a few (1 to 8 typically) processor cores that can each do their own thing. They are designed to do general tasks and lots of different operations, a lot of their time will be spent on the logic of working out what needs to be done rather than doing maths. They have all sorts of special tricks to speed things up like on the fly they can change the order of the operations in the code.

The GPU has lots of cores (hundreds or thousands) that all run the same code on different sections of the same big block of data. They are designed to tasks that are mathematically complicated and require lots of calculation and memory access but far less control logic.

It’s also worth mentioning DSPs (Digital Signal Processors), they have been around for far longer than GPUs and are somewhere in between GPUs and CPUs. They are designed like a GPU to do maths heavy tasks with lots of memory access and minimal control logic and other IO. The difference is that like a CPU they only have a few independent cores rather than lots of grouped ones sharing the same memory.

They can all be made to do the same job, is purely a question of how well they can do it. A CPU is a generalist device, a GPU is a highly optimised device that gains performance in one type of task at the cost of performance at others.

Anonymous 0 Comments

What’s the difference between a sports car and a bus? They both move people from one place to another.

Let’s ignore speed limits and traffic here. CPUs are like sports cars. If you need to get one person from here to there, they’re great. If you need to get fifty people from here to there… You’ll want a bus. It’s all still moving people from here to there, but the bus does a lot more people in just a little more time.

The bus is better *if* everyone is going in the same direction and *if* you’ve got a lot of people. Similarly, GPUs are better *if* all the computations are similar and *if* you have a lot of computations. Luckily, it just so happens that “working out what colour each of a billion or more pixels should be” meets those criteria. However, if people are going in different directions (or the computations are varied), or if you have a small number of people (or computations) and they all want to get there as quickly as possible, that sports car (or CPU) starts looking better.=

Anonymous 0 Comments

A CPU is like a horse-sized duck. There’s only one, but it’s a monster.

A GPU is like a hundred duck-sized horses. Not that powerful individually, but just look at ’em all!

So if you have one complicated task, give it to the CPU. If you have a gazillion things you want done all at the same time, give them to the GPU.

Anonymous 0 Comments

A CPU is optimized for performing general purpose instructions that are useful for applications. They can usually do only a few things at a time – maybe a dozen. They are good at reading and writing from arbitrary places in memory, and performing several different mathematical and logical functions on small pieces of data (addition, multiplication, comparison of two values, etc.).

CPUs are also very good at branching: looking at the results of calculations, and doing entirely different things depending on the values (for example: if “lives = 0” then run the “end of game” code, otherwise run the “respawn” code.

On the other hand, GPUs are optimized for executing the same instruction on many different pieces of data. For example, take the square root of each of the one million values in a one thousand by one thousand grid. Usually they are particularly good at floating point arithmetic.

GPUs are optimized to be able to do all these calculations at the same time, taking far less time than a CPU, which can only do a few things at once. On the other hand, if you used a GPU to perform just a few calculations, then based on the results, perform a few other calculations, you would be wasting its capabilities, and it would be quite slow.

Both GPUs and CPUs are “Turing complete”. This means that they can basically doing anything that a computer can do, given enough time and memory. Neither is more capable than the other, in that sense, though each is much quicker than the other doing what it is good at.