I'm proud to announce that I have completed vectorizing both the IIR and FIR filters. Speed ups are about 5x for IIR and ~20x for FIR (see spreadsheet). The code is a monstrosity, but given all the different cases ( {FIR, IIR} x {int16, float, double} x {RGBA, grayscale} as Jasper pointed out, it's expected. Earlier, I had only worked on the IIR, RGBA case, so it wasn't complete. It's unfortunate I let it languish for 3 years, but now hopefully, everyone can get a smoother experience.
Please test it out and send some feedback and a path for checking in.
A unit test & benchmark function is included. The accuracy is always +- 1 intensity level, which should be quite safe.
To build it, please add this to your cmake command: -DCMAKE_CXX_FLAGS="-DWIN32 -mavx2 -mfma -fpermissive -flax-vector-conversions"
You'll also need to turn on -std=c++14 if compiling the unit test & benchmark
Todo list:
*support processors with SSE2 only? current version only works on an AVX2 processor *dynamic dispatch for different CPU types - I guess there should be 3 versions of the functions (SSE2, AVX1, AVX2) *better ways to deal with SIMD remainders? The current code never writes past the end of a row, but liberally uses vector loads that go past the end. This will render memory error checking tools like AddressSanitizer useless with false positives. Ideally, I'd like all the Cairo images to be padded to either 16 (SSE2) or 32 bytes (AVX), but that might not be practical. *document all the arcane optimization methods (cache blocking, do-while loops, Duff's device) for posterity. Preferably with SVG animations
-Yale
On Wed, Mar 6, 2013 at 11:23 AM, Johan Engelen <jbc.engelen@...2592...> wrote:
On 4-3-2013 6:44, Yale Zhang wrote:
... but I'll still go ahead with the vectorized implementation.
Yes please do! I'm very interested in how to include SIMD code and how to go about vectorizing code; great if we have an example in our codebase.
Cheers, Johan
Symantec Endpoint Protection 12 positioned as A LEADER in The Forrester Wave(TM): Endpoint Security, Q1 2013 and "remains a good choice" in the endpoint security space. For insight on selecting the right partner to tackle endpoint security challenges, access the full report. http://p.sf.net/sfu/symantec-dev2dev _______________________________________________ Inkscape-devel mailing list Inkscape-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-devel