Skip to content

An attempt to speed up a portion of the ACTS project multiplying matrices

Notifications You must be signed in to change notification settings

Scott-James-Hurley/The_Matrix_Refactored

Repository files navigation

The_Matrix_Refactored

An attempt to speed up a portion of the ACTS project multiplying matrices

Files

MtxMult.cpp - Benchmark for functions multiplying two 6x6 matrices
MtxMultArb.cpp - Benchmark for functions multiplying two matrices of user-defined size (default is 6x6)
MtxMultTrans.cpp - Benchmark for functions calculating the similarity (A * B * T(A)) of two 6x6 matrices
MtxMultTransArbSize.cpp - Benchmark for functions calculating the similarity (A * B * T(A)) of two variable-size matrices (default is 6x6)
MtxMultTransManual.cpp - Benchmark for calculating the similarity (A * B * T(A)) of two 6x6 matrices where each calculation is explicit

Requirements

This project requires ACTS and its prerequisites as well as OpenBLAS

Compilation

Compile files using the following command:

g++ -std=c++17 -O3 -march=native -mavx -mfma -m64 -I/path/to/eigen -I/path/to/SMatrix -I/path/to/acts/Core/include filename.cpp -lm -o filename.exe

Example:
g++ -std=c++17 -O3 -march=native -mavx -mfma -m64 -I/usr/local/include/eigen3 -I/usr/local/include -I/acts/Core/include MtxMultArb.cpp -lm -o MtxMultArb.exe

MtxMultTrans.cpp requires the openblas library for one of the similarity functions implemented and so requires the following command to compile: g++ -std=c++17 -O3 -march=native -mavx -mfma -m64 -I/path/to/openblas/include -L/path/to/openblas/lib -I/path/to/eigen -I/path/to/SMatrix -I/path/to/acts/Core/include -Wl,-rpath,/opt/openblas/lib filename.cpp -lm -lpthread -lgfortran -lopenblas -o filename.exe

Example:
g++ -std=c++17 -O3 -march=native -mavx -mfma -m64 -I/opt/openblas/include -L/opt/openblas/lib -I/usr/local/include/eigen3 -I/usr/local/include -I/acts/Core/include -Wl,-rpath,/opt/openblas/lib MtxMultTrans.cpp -lm -lpthread -lgfortran -lopenblas -o MtxMultTrans.exe

Changing Matrix Size

To change the dimensions of the marices used in MtxMultTransArbSize.cpp, define the following macros when compiling: M1ROWS and M1COLUMNSM2ROWSCOLUMNS.

To change the dimensions of the marices used in MtxMultArb.cpp, define the following macros when compiling: M1ROWS, M1COLUMNSM2ROWS and M2COLUMNS.

Like so:
g++ -std=c++17 -DM1ROWS=8 -DM1COLUMNSM2ROWS=8 -DM2COLUMNS=8 -std=c++17 -O3 -march=native -mavx -mfma -m64 -I/usr/local/include/eigen3 -I/usr/local/include -I/acts/Core/include MtxMultArb.cpp -lm -o MtxMultArb.exe

About

An attempt to speed up a portion of the ACTS project multiplying matrices

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages