open-ephys-plugins / neuropixels-pxi

Open Ephys GUI plugin for interfacing with PXIe-based Neuropixels hardware
GNU General Public License v3.0
12 stars 18 forks source link

Feature request/suggestion: AVX Vectorization #34

Open shayokdutta opened 8 months ago

shayokdutta commented 8 months ago

Hi!

I put together code for AVX instructions/vectorization that's functional with the Neuropixels1_v3 API. I'll quantify how much this speeds up the processing for closed-loop experiments I'm trying to run. I am avoiding the zmq interfacing that's suggested so it's a little different from utilizing the plugin methodology. It's relatively well commented. Probably won't get around to sort of integrating this with all of the NPX header files...just the ones I'm using so I haven't done a pull request here. Feel free to take a look if y'all have time and would like to integrate it. Will be cleaning it up and documenting latencies and such after Thanksgiving break. Happy to help out as well time permitting or answer questions.

https://github.com/shayokdutta/neuropixels-pxi-rippleDetectorUI-Integration/tree/main

Primary changes are in the run() function within the Neuropixels1_v3.cpp file. Probe components did have a couple additions and such though for offsets and such.

jsiegle commented 8 months ago

Hi Shayok, thanks for this suggestion! Please do keep us posted on the latency benchmarking – if there's a clear speedup then we can apply these changes to the other probe types.

FWIW, data passing between plugins is zero-copy, and doesn't use ZMQ...data is operated on sequentially via a reference to a buffer object. If you wrapped the ripple detector interface in a plugin it would make it much easier to share and re-use. Let us know if you have time to chat about your overall goals – we'd be happy to provide advice on the best strategy.