Working on some more libscopehal backend tweaks. Most scopes we work with take i...

@azonenberg@ioc.exchange

Working on some more libscopehal backend tweaks.

Most scopes we work with take in int8 ADC sample data, which is then converted to float32 before further processing.

The original baseline implementation of this process was a simple loop on the CPU, which later got vectorized with AVX (but the fallback version kept for non-AVX platforms). This then got an OpenMP wrapper around it for converting multiple channels in parallel on different CPU cores.

The next iteration was to add a GPU shader, dependent on GL_EXT_shader_8bit_storage being available, available, to do sample conversion.

This shader runs one GPU thread per sample, reads an int8, writes back a float32. It works, and is significantly faster than the CPU.

For example, on my Xeon 8362 + R9700 test system, converting ten million points takes:
* CPU baseline: 10.5 ms
* AVX2: 9.2 ns
* First shader: 0.89 ms

But now we have three different implementations of the same logic floating around, and lots of complex conditional logic around dispatch.

Plus I'm planning to transition away from OpenMP due to portability/tooling complexity issues and the thread pools being annoying when debugging, needing some environment variables set on startup, it's just generally a PITA.