Added Code for 32x32 matrix that leaves 343 misses

master
anna_schlittenhardt 2020-12-19 11:45:38 +01:00
parent 3f8f3c3654
commit 8e9a49a0c8
1 changed files with 20 additions and 2 deletions

View File

@ -17,7 +17,6 @@
#include "cachelab.h"
int is_transpose(int M, int N, int A[N][M], int B[M][N]);
/*
* transpose_submit - This is the solution transpose function that you
* will be graded on for Part B of the assignment. Do not change
@ -27,7 +26,26 @@ int is_transpose(int M, int N, int A[N][M], int B[M][N]);
*/
char transpose_submit_desc[] = "Transpose submission";
void transpose_submit(int M, int N, int A[N][M], int B[M][N])
{
{
//343 misses (goal: <300; 0 points if >600)
if(N == 32){
int n, m, nn, mm;
for (n=0; n<N;n+=8){
for (m=0;m<M; m+=8){
for(nn=n; nn<n+8;nn++){
for(mm=m; mm<m+8;mm++){
B[mm][nn] = A[nn][mm];
}
}
}
}
}
if(N == 64){
}
}
/*