3 ms·
> You need something that…deals with almost nothing but floats. This hasn't been true for years. GPU integer compute is quite good these days.
by pcwalton 9y ago
> You need something that…deals with almost nothing but floats.
This hasn't been true for years. GPU integer compute is quite good these days.
- kllrnohj 9y agoGPUs will handle ints just fine, but it's not what they are best at. They are best at fp32, and depending on the GPU the gap is rather substantial. The performance characteristics of integer ops is also kinda weird.
- pcwalton 9y agoWe can solve this by looking at the published latencies: http://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html#arithmetic-instructions http://docs.nvidia.com/cuda/cuda-c-programming-guide/index.h... And indeed 32 bit integers and 32 bit floats are essentially the same, except for multiplication where it's fuzzy, but still quite fast. Certainly modern GPUs are fast enough at integer ops that you shouldn't just assume your problem will be slow on the GPU just because it's integer based. Bitcoin mining (as much as I hate to bring it up) is an obvious counterexample, for instance.
- deleted 9y ago[deleted]
- nhaehnle 9y agoAMD GPUs actually have identical performance for int32 and fp32, except for full 32-bit integer multiplies and divisions. I think that's a big part of why cryptocurrency miners like them so much.
- fulafel 9y agoWebGL now has integer types in shaders as well.