Is there any problems we can solve using CPU faster rather than using GPU?

Recently I always hear that GPU is very powerful in computing, and now a question occurs in my mind: Is there any problems we can solve using CPU faster rather than using GPU?

In what situation we should use GPU?

Can you give me some examples?

Thank you.

Dealing in absolute generalities, you could say that any serial problem is better handled by a CPU. If you cannot parallelize your problem, there is no case to be made for using a GPU.

Problems which have very strong dependencies between elements and problems with lots of branching.

So GPU is designed for parallel computing?

I see, independent threads are nesessary for GPU. Is there any way to share data among all the threads?

? How did you think they worked ?

Like pasoleatis said, any algorithm which is dependent on previously calculated values and can branch in multiple directions.

Also when the data set (or problem space) is small there really is no reason to use GPU, as there is a small amount of memory copy overhead to use GPU, while this does not exist generally for CPU.

example of algorithms which would be better on CPU;

some recurrences like FIB

F(n)= F(n-1)+F(n-2)

Graph algorithms are difficult to map to GPUs, especially if they use DFS.

In general there usually is a way to get a problem to work on the GPU, even if it is serial in nature, but usually the time spent on such a solution is not worth the benefit.

When GPUs do outperform, it is when there is some section of the problem which can be fit into a parallel model. CPUs can force an ordering, and GPUs can do the ‘heavy lifting’.