Repository for the Acts Linear Algebra vectorization project: It contains infrastructure to develop, test and benchmark linear algebra operations based on different backends. A reference implemenation is given using the Eigen library. The Vc library has been setup as an example for an explicitely vectorized implementation. Testing and benchmarking are done with google test and google benchmark.
To build the project do:
git clone https://github.com/niermann999/Acts_vectorized_LA_backend.git
mkdir Acts_vectorized_LA_backend/build
cd Acts_vectorized_LA_backend/build
Run cmake, e.g.
cmake -DCMAKE_BUILD_TYPE=Release ..
make -j4
All dependencies should build automatically.
You can find the executables in the build/src
folder after running CMake.
The repository contains code to set up data for testing and benchmarking, the implementation of different matrix/vector operations, as well as dedicated unittest and benchmarks for every single operation:
externals/
contains external dependencies like Eigen and Vc etc.data/
containsfixtures
that set up test and benchmark data which can be reused across multiple test/benchmark instances. The test data defines input matrices/vectors and results for every operation. The benchmark data fills a number of input matrices/vectors with random values.definitions/
provides definitions for matrix and vector types, depending on which library/linear algebra implementation should be used. You are free to add your own.benchmarks/
contains a benchmarking suit that runs every LA operation on random data multiple times and outputs the statistics of the performance.tests/
contains automated unit tests for every LA operation. Note, that the Vc based multiplication test fails, since there is no implemention for that, yet.
Please have a look at the include/matrix_operations.hpp
file. You will find there a number of example implementations of very simple matrix x matrix
operations. The Addition of two matrices is provided using both Eigen and Vc. The multiplication is only given in Eigen, as the vectorized multiplication operation should be implemented by you. You can use the Vc infrastructure (Vc documentation) that is already provided in include/definitions/types.hpp
, but you are also welcome to use a different library or your own types. Please keep portability in mind though, since the Acts project will be deployed across a number of different computing platforms.
You can test your solution by running the predefined unittests and benchmarks. The vectorized
multiplication function is already integrated using the default data fixtures. If in your solution you want to use a different data layout, please add your own fixtures for unittesting and benchmarking. You can use the existing implementation as a guide.
Please also try to answer the following questions:
- Do you think 4x4 matrix operations are more or less efficientiently vectorizable than e.g. 3x3 or 5x5 matrices?
- Do you expect a performance difference when using double instead of single precision floating point vector elements. If so, why?
- How can you tell that your solution is actually vectorizing?
Hand in your solution (any changed files and answers to the questions) by email to the mentors, e.g. [email protected]. Please clone the repository locally and do not make a public pull request to this repository, as it can be viewed by anyone!
VERY IMPORTANT: Also hand in implementations that do not show an improved performance or a very bad performance compared to Eigen! It might nevertheless be a good solution!
If you have any questions regarding the code/repository, the evaluation task or otherwise, please do not hesitate to contact me ([email protected]) or any of the other mentors!