The ‘matrix-multiply-omp’ resource runs a multiplication on two 300x300 matrixes followed by a multiplication of two 150x150 matrices. These two matrix opperations are iterated over by an amount specified by the user via the first parameter. This binary utilizes OpenMP to parallelize the matrix operation. The number of threads used is specified by the user via the second parameter.
Run make
.
Run make clean
in the Makefile directory.
As this binary does not contain any special m5
library code it can be run outside of a gem5 simulation:
./matrix-multiply-omp <number of iterations> <number of threads>
The first parameter is the number of iterations to make for the two matrix multiplication operations. The second parameter is the number of threads to run the matrix multiplications on.
It can also be run in a gem5 simulation in SE mode. Below is a snippet which utilizes the gem5 standard library to do so:
board.set_se_workload(Resource("x86-matrix-multiply-omp")) simulator = Simulator(board = board)
Compiled to the X86 ISA: http://dist.gem5.org/dist/develop/test-progs/matrix-multiply-omp/x86-matrix-multiply-omp-20230127.
This code was taken from http://blog.speedgocomputing.com/2010/08/parallelizing-matrix-multiplication.html.
It is licenced under Creative Commons Attribution-Noncommercial-ShareAlike 3.0 Unported.