Skip to content

Comparison between different ways of multiplying matrices in C++ and Python. The standard textbook method, block method with cache, BLAS, and Numpy were compared. A detailed report is provided. This work is done to fulfill a university assignment

License

Notifications You must be signed in to change notification settings

proxy-pylon/Matrix-multiplication-comparison

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build and Run Guide

Prerequisites

  • Ubuntu 24.04 (WSL works fine)
  • GCC with OpenBLAS (sudo apt install build-essential libopenblas-dev)
  • Python 3.12 with numpy, pandas, matplotlib

Build C++ code

make

Run C++ benchmarks

source env_single_thread.sh ./mm_bench --m 2000 --step 100 --nb 128 --base_reps 8 --csv results/cpp.csv

Run python benchmarks

python3 -m venv .venv source .venv/bin/activate pip install numpy pandas matplotlib python3 scripts/mm_bench.py --m5 300 --step 20 --base_reps5 60 --base_reps6 8 --csv results/python.csv

Generate plots

python3 scripts/plot_results.py

Plots will appear in the plots/ folder.

About

Comparison between different ways of multiplying matrices in C++ and Python. The standard textbook method, block method with cache, BLAS, and Numpy were compared. A detailed report is provided. This work is done to fulfill a university assignment

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published