News for hackers. Stuff that matters.
Re:Prefix Sum with SIMD by fleabitdev on Saturday February 12, 2022 @09:00AM (#30312860)
I recently experimented with Rust's std::simd library prototype, and it gave me the same sense of wasted potential.

My program performed complicated processing of large 8-bit grayscale images. Naive use of portable SIMD made several important parts of the algorithm run ten times faster than my integrated-GPU implementation! (OpenGL ES 3.0 over ANGLE on an Intel HD Graphics 520)

I think the sheer power of modern SIMD has slipped past most peoples' radar. A multicore processor with AVX2 has number-crunching throughput comparable to a low-end GPU, and for some workloads, the extra flexibility of the CPU can unlock an additional order-of-magnitude performance uplift. (The comparison may be a little different if you're programming the GPU with modern compute shaders - I'm not sure.)

Portable SIMD programming is also just fun! Trying to keep my working set within the 32 KiB L1 cache, trying to keep my data packed within individual 8-bit lanes, and lacking access to some basic operations like integer multiplication and division - it almost feels like programming for a retro games console.

Re:Prefix Sum with SIMD by dahart on Saturday February 12, 2022 @11:18AM (#30313872)
> it almost feels like programming for a retro games console.

I get this feeling writing CUDA code all the time, having to keep my stack frames and local data small, figuring out how to even out and time-slice the work. It’s a little like Arduino coding in a way, it’s just that instead of one of them running at 16Mhz, I have ten thousand of them running at 2Ghz (and as a bonus they have floating point superpowers).

Re:Prefix Sum with SIMD by shakow on Saturday February 12, 2022 @10:58AM (#30313723)
I concur. I recently ported some bioinfo computations from scalar to SIMD with primitives from core::arch, and the gain was an immediate ~10×.

It is a shame that one needs to fiddle with RUSTC_FLAGS just for SIMD extensions to trigger though :/

Re:Prefix Sum with SIMD by Royi on Saturday February 12, 2022 @09:40AM (#30313123)
Have you looked at [ISPC - Intel SPMD Program Compiler][0]?

  [0]: https://github.com/ispc/ispc