Algorithm
If the sizes of A and B are less than the threshold
Compute C = AB using the traditional matrix multiplication algorithm.Else use Strassen's algorithm
Split matrices A and B
For each of
Mi i = 1 to 7
Create a new thread to compute
Mi = A'i B'i
If the sizes of the matrices are less than the thresholdCompute C using the traditional matrix multiplication algorithm.
Else use Strassen's algorithm
Split matrices A'
i and B'i
For each of M
ij j = 1 to 7
If i=7 and j=7 go to step 1 with A = A'77
and
B = B'77
Get a thread from the thread pool to compute
M= A'ij B'ij
Execute the recursive version of Strassen's algorithm in this threadWait for the Mij
threads to complete execution
Compute MiWait for the Mi
threads to complete execution
Compute CProgram