| ▲ | jvanderbot 2 hours ago | |||||||
I do this. I do this a lot. My job involves processing a significant amount of weather data and flight telemetry _very quicky_. What I have found is that getting rust to auto-vectorize is a nightmare. The options available to me have always converged around: 1) use simd-like apis 2) frame it as matrix-vector operations. (1) is touched on in TFA (2) is way easier, and allows use of well-tested apis and crates, each of which (sensibly) call out to better-tested C libraries. Each of those can, should, might, or will use your CPU better than you will. If you can frame it as matrix-vector operations, you will go very fast, not least of which, by stacking the operations into a _big_ matrix/vector op, which your CPU will happily tear though. However the article proposes a third, very cool option: use algebraic ops API! Worth a read. | ||||||||
| ▲ | the__alchemist 2 hours ago | parent [-] | |||||||
Great insight. My (much less sophisticated) mental model is: 1: I don't know how to get things to auto-vectorize nor evaluate if they did. [I should learn]; I assume they do not. Manual SIMD it is! [I have a lib for floats and vectors which mimics core::simd but on stable and x86 only) I will check out your insights regarding matrix-vector ops and C libs! | ||||||||
| ||||||||