/******************************************************************************************************* * * CDAC Tech Workshop - hyPACK 2013 * Oct 15 - 18 , 2013 * * FILE : mat-mat-mul-function-offload.c * * INPUT : Matrix size * * OUTPUT : Time Elapsed * * CREATED : October,2013 * * EMAIL : hpcfte@cdac.in * * ****************************************************************************************************/ #include #include #include "offload.h" double dtime() { double tseconds = 0.0; struct timeval mytime; gettimeofday(&mytime,(struct timezone*)0); tseconds = (double)(mytime.tv_sec + mytime.tv_usec*1.0e-6); return( tseconds ); } __attribute__((target(mic))) void doMult(double *a,double *b,double *c,int size) { int i,j,k; #pragma omp parallel for for(i=0;i \n",argv[0]); exit(1); } size=atoi(argv[1]); //printf("size=%d\n",size); rc=posix_memalign((void **)&Matrix_A,64,size*size*sizeof(double)); rc=posix_memalign((void **)&Matrix_B,64,size*size*sizeof(double)); rc=posix_memalign((void **)&Matrix_C,64,size*size*sizeof(double)); //Initialisation of Matrices for(i=0;i 0.0) printf("Time Elapsed = %lf\n",TimeElapsed); /*for(i=0;i