3 ms·
- CPUs can do 64x64 multiplies that give 128-bit results. GPUs cannot. - CPUs can do add-with-carry. GPUs cannot. That means that GPUs are not very good at doi
by brucedawson 11y ago
- CPUs can do 64x64 multiplies that give 128-bit results. GPUs cannot.
- CPUs can do add-with-carry. GPUs cannot.
That means that GPUs are not very good at doing high-precision math. They lose a lot more efficiency implementing high-precision math than CPUs do. And GPUs are also worse at doing parallel calculations that end up following different paths, which inevitably happens when one pixel diverges before another.
My back-of-the-envelope estimates show that GPUs are not worth it for this use-case. I will change my mind when I see a GPU-based deep zoom fractal program.
- WheretIB 11y agoWhile AMD GPU can't do 64x64 multiplies that give 128-bit results, they still can do a 32x32 multiply with a 64-bit result. (MULHI_INT and MULLO_INT instructions). And you can do add-with-carry manually on the AMD GPU using two instructions: ADDC_UINT to get the carry flag from an addition followed by ADD_PREV to add it.
- brucedawson 11y agoGood to know. I was not aware of those instructions. It would be interesting to see how well a GPU can do compared to a CPU. Doing 64-bit math gives an automatic four-to-one advantage (it takes four 32x32 multiplies to replicate a single 64x64 multiply) so the GPU would be starting out at a disadvantage, plus GPUs run at lower clock rates and have other disadvantages, but perhaps their many many cores would be enough to overcome this.