MCPcopy Create free account
hub / github.com/AdvancedCompiler/AdvancedCompiler / Verify_matrix_c

Function Verify_matrix_c

code/Chapter11/mympi.h:110–133  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

108 printf("----------------------------------\n");
109}
110void Verify_matrix_c(data_t *A,data_t *B,data_t *C,int m1,int n1,int n2){
111 data_t *matrixPool;
112 int i;
113 matrixPool=malloc(sizeof(data_t)*m1*n2);
114 Init_Matrix(matrixPool,m1*n2,1);
115 Mul_Matrix(A,B,matrixPool,m1,n1,n2);
116 for(i=0;i<m1*n2;i++){
117 if(C[i]!=matrixPool[i]){
118 printf("计算结果错误!\n");
119 if(m1*n2<=36){
120 printf("A:\n");
121 Print_matrix(A,m1,n1);
122 printf("B:\n");
123 Print_matrix(B,n1,n2);
124 printf("C:\n");
125 Print_matrix(C,m1,n2);
126 printf("real-C:\n");
127 Print_matrix(matrixPool,m1,n2);
128 }
129 return;
130 }
131 }
132 printf("计算结果正确!\n");
133}
134#endif

Callers

nothing calls this directly

Calls 3

Init_MatrixFunction · 0.70
Mul_MatrixFunction · 0.70
Print_matrixFunction · 0.70

Tested by

no test coverage detected