CERN Workshop on Numerical Computing, May 2014

Agner Fog

Methods for vectorization of mathematical software and performance measurements

Files:

Test different vector implementations of mathematical functions

Unpack mathtest.zip to a separate folder.
Compile and run testvectormath.cpp with appropriate command line parameters, e.g.
g++ -Ofast -mavx testvectormath.cpp Run several times with ./a.out to see if you can get consistent timings.

Things you can try to vary:

 

Test with performance monitor counters

Unpack testp.zip to a separete folder. Then unpack DriverSrcLinux.zip and PMCTest.zip. Install the driver as explained in testp.pdf. Make all scripts executable with chmod a+x *.sh

To test a small piece of C++ code: Edit PMCTestB.cpp, and run ./c64.sh

To test a small piece of asm code: Edit PMCTestB64.nasm, and run ./a64.sh

To enable performance monitor counters for use in another program: Run ./c64.sh, then run ./a.out startcounters
Now you can use the performance monitor counters in testvectormath.cpp or in your own program. You can specify different performance monitor counters in PMCTestB.cpp or on the command line.

To measure latency and throughput of all machine instructions, unpack TestScripts.zip and run some of the scripts therein. You may need to update nasm as described in testp.pdf.

Powerpoint from my talk

link

My website with optimization manuals and other resources

www.agner.org/optimize