4 ms·
GPU single threads are up to 20x slower the CPU threads. GPUs get their speed from massive parallelization, SIMD style "do N things 1 one instruction", and some
by nox101 2y ago
GPU single threads are up to 20x slower the CPU threads. GPUs get their speed from massive parallelization, SIMD style "do N things 1 one instruction", and some specialized hardware (like texture samplers)
If you take a serial algorithm and put it on the GPU, it's easy to verify that a single GPU thread is much slower than a single thread on the CPU. For example, just do a bubble sort on the GPU with a single thread. I'm not even including the time to transfer data or read the result. You'll easily find the CPU is way faster.
The way you get GPU speed is by finding/designing algorithms that are massively parallel. There are lots of them. There are sorting solutions for example.
As an example, 100 cores * 32 execution units per core = 3200 / 20 = 160x faster than the CPU if you can figure out a parallel solution. But, not every problem can be solved with parallel solutions and if it can't then there's where the CPU wins.
It seems unlikely GPU threads will be as fast as CPU threads. They get their massive parallelism by being simpler.
That said, who knows what the future holds.
- shaklee3 2y agoThis is totally inaccurate. There is nothing 20x slower about a GPU core unless you're nitpicking, in which case you can show those same GPU cores are 20x faster than CPU for other things.
- nox101 2y agoDo you have examples of a single GPU thread outperforming a single CPU thread? Here's mine https://jsfiddle.net/jw7a6to9/ https://jsfiddle.net/jw7a6to9/ bubblesort https://jsfiddle.net/y1w6s9tj/ https://jsfiddle.net/y1w6s9tj/ taylor series > in which case you can show those same GPU cores are 20x faster than CPU for other things Which things? Remember, I wrote single thread, no SIMD, no samplers. It's the parallelism that provides the speed.