Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm trying to understand the relative strengths of CPUs vs GPUs.

Quoting popular opinion, "the more cores, the better", so by that logic, a GPU should always outperform a CPU, and it does with cryptocurrency mining and quant finance since I just whipped up a quick program that calculates implied volatilities in an extreme fraction of the time with my GPU vs my CPU.

But as I've been investigating the subject, I've come across Q&As like this.

I apologize if this question may be too broad, but I've only had rudimentary electrical engineering training and was wondering if there was a silver bullet explanation as to why a CPU is preferred over a GPU for normal tasks such as those described in the linked Q&A: "branch prediction, pipelining, superscaler, etc."

(As a bonus, what does this quote mean: "Additionally, the algorithms needed did not have to deal with branches, since nearly any branch that would be required could be achieved by setting a co-efficient to zero or one.")

share|improve this question

migrated from electronics.stackexchange.com Dec 23 '13 at 14:01

This question came from our site for electronics and electrical engineering professionals, students, and enthusiasts.

1  
This is probably better suited for somewhere like cstheory.stackexchange.com –  Fake Name Dec 23 '13 at 9:33
    
@ConnorWolf Thank you for looking Connor Wolf! I apologize. I thought that it had something to do with with their relative physical structures. If not, please migrate. Thank you so much in advance! –  user174734 Dec 23 '13 at 9:56
    
@Gracchus, there isn't a normal migration path for that site so flag as "other (needs ♦ moderator attention)" and say you'd like it migrated. –  PeterJ Dec 23 '13 at 12:05

2 Answers 2

A GPU's architecture is designed to handle vector algorithms and programs, such as math computation especially for graphics, that does not do a lot of branching and jumping and is more concerned with the flow of data through the processor. Therefore it's more streamlined for this while a general purpose CPU has a different architecture that can handle the jumps and branches better at the expense of data flow.

If you look for the layout of either of these CPU types, it will be evident how they are different.

(I know this answer is a little lame but I just woke up and it's been years since I've done processor design.)

share|improve this answer

The second answer in the question you linked (not the accepted one, but the one which got most votes) is well written and sufficiently detailed in my opinion.

If you are willing to get a deeper understanding of the concepts named there, I think you'd better ask separate questions for each one (and explain what exactly you do not understand). The reason is that these concepts are both architectural and micro-architectural, and their description at any acceptable level requires a separate question.

In analogy, you can think of CPUs as a Swiss Knife - it can do a lot of stuff and will be helpful in any situation. However, if you know that you're about to cut a salad for 300 people - any kitchen knife will outperform the most sophisticated Swiss. GPU is a kitchen knife.

CPUs are better suited for a wide variety of tasks performed by a "regular" user. However, if a user knows that the task will require extensive mathematical calculations, GPU should be considered. If the task, in addition to being mathematical calculations, may be paralleled - this task may be labeled as "GPU tailored".

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.