2 ms·
> To give another example, try writing a linear algebra library that's generic over the data type without this feature (and such libraries are essential for hig
by aktau 11y ago
> To give another example, try writing a linear algebra library that's generic over the data type without this feature (and such libraries are essential for high performance graphics programming).
I disagree. My best, fastest to compile code has always focused on just one type. You mention graphics programming: for 99.999% of the cases you want to pick a type. Usually, this will be float, and thus for SIMD a 4 or 8-vector of these, like https://github.com/aktau/threedee-simd/blob/master/include/threedee/types.h https://github.com/aktau/threedee-simd/blob/master/include/t.... Despite the support of recent graphics cards for doubles, the fact is that they are usually quite a bit slower. Even when precision bound, there are usually tricks that will let one keep using floats (esp. wrt to Z-buffers).
- pcwalton 11y agoIt's very useful to use different types (for example, fixed point) in VBOs in order to save space and/or reduce CPU side processing.