float vs double on graphics hardware

后端 未结 4 767
隐瞒了意图╮
隐瞒了意图╮ 2021-02-01 04:51

I\'ve been trying to find info on performance of using float vs double on graphics hardware. I\'ve found plenty of info on float vs double on CPUs, but such info is more scarce

4条回答
  •  盖世英雄少女心
    2021-02-01 05:18

    In terms of speed, GPUs are optimized for floats. I'm much more familiar with Nvidia hardware, but in current generation hardware, there is 1 DP FPU for every 8 SP FPU. In next generation hardware, they're expected to have more of a 1 to 2 ratio instead.

    My recommendation would be to see if your algorithm needs double precision. Many algorithms don't really need the extra bits. Run some tests to determine the average error that you get by going to single precision and figure out if it's significant. If not, just use single.

    If your algorithm is purely for graphics, you probably don't need double precision. If you are doing general purpose computation, consider using OpenCL or CUDA.

提交回复
热议问题