- Python: Initialize the matrices with a constant seed (4x4, 8x8, 16x16, and so on) and alpha beta constants just like gemm
- Python: Start the timer and pass these values and matrices to C++ code
- C++: Do the multiplication just like with and without optimiation (finally if it possible add openmp)
- Python: Stop the timer and store the time value
Create a virtual environment using this command:
python3 -m venv env
Activate the environment:
On Unix:
source env/bin/activate
Run the following command to install the python dependencies for the project:
pip install -r requirements.txt
Run the following command to build the project in place:
python3 setup.py build_ext --inplace
If everything is set up correctly, you can run the main script with the default values by executing:
python3 main.py
To customize the parameters, you can use the following command:
python3 main.py --matrix_size=4 --optimization_num=0 --alpha=1.5 --beta=1.2 --random_seed=42
Troubleshooting If you encounter any errors, you might need to install additional dependencies. Use the following commands:
sudo apt-get install libboost-python-dev
sudo apt-get install python3-all-dev
In setup.py, the boost_python310 module is specified. To check the Boost version on your computer and ensure compatibility, use this command:
find /usr/lib /usr/local/lib -name "libboost_python*.so"
If the Boost version does not match, install the required version.