This repository contains an optimized program that performs matrix multiplication using a tiling optimization technique. Tiling is known to enhance cache utilization by breaking larger matrices into smaller submatrices or tiles, allowing for efficient multiplication.
- Efficient matrix multiplication with tiling optimization.
- Compatibility check for matrix dimensions before multiplication.
- Unit testing to compare tiled results against a baseline non-tiled multiplication.
- Interactive CLI for users to input matrix dimensions, tile size, and matrix values.
Ensure you have a C++ compiler installed on your machine. This code has been written in C++ and requires a compiler supporting C++11 or later.
git clone https://github.com/FahimaChowdhury/2DMatrixMultiplierWithTiling.git
cd MatrixTilingMultiplication
g++ -g ./src/tile_matmul.cpp -std=gnu++2a -Wall -o main
./main
- Enter the dimensions of matrix A.
- Enter the dimensions of matrix B.
- Input the desired tile size.
- Provide the matrix values for A and B.
After the multiplication, the program runs a unit test to compare the results from the tiled multiplication against a baseline matrix multiplication. Any discrepancies will be reported, ensuring the accuracy of the optimization.
- Me