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

Function main

code/Chapter12/12-5-hip-matrix.cpp:47–67  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

45 hipFree(d_C);
46}
47int main(int argc,char **argv){
48 float *A,*B,*C;
49 double start_time,end_time;
50 A=(float*)malloc(sizeof(float)*DIMS*DIMS);
51 B=(float*)malloc(sizeof(float)*DIMS*DIMS);
52 C=(float*)malloc(sizeof(float)*DIMS*DIMS);
53 Init_Matrix(A,DIMS*DIMS,2);
54 Init_Matrix(B,DIMS*DIMS,2);
55 Init_Matrix(C,DIMS*DIMS,1);
56 //start
57 start_time=(double)clock();
58 Mul_Matrixdcu(A,B,C,DIMS,DIMS,DIMS);
59 //end
60 end_time=(double)clock();
61 printf("进程的执行时间为:%.2lf\n",(end_time-start_time)/1e6);
62 // Verify_matrix_c(A,B,C,DIMS,DIMS,DIMS);
63 free(A);
64 free(B);
65 free(C);
66 return 0;
67}

Callers

nothing calls this directly

Calls 2

Init_MatrixFunction · 0.70
Mul_MatrixdcuFunction · 0.70

Tested by

no test coverage detected