Added Code for 32x32 matrix that leaves 343 misses
parent
3f8f3c3654
commit
8e9a49a0c8
20
src/trans.c
20
src/trans.c
|
@ -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
|
||||
|
@ -28,6 +27,25 @@ 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){
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in New Issue