Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
18BCE2182 ASSESS_1 Q2-2
#include <stdio.h> #include <stdlib.h> #include <omp.h> #define M 5 #define N 5 int main(int argc, char *argv) { int i,j; double start, end, start_p, end_p; double **A, **B, **C; A= malloc(M*sizeof(double *)); B= malloc(M*sizeof(double *)); C= malloc(M*sizeof(double *)); for(i=0; i<M; i++) { A[i]= malloc(N*sizeof(double)); B[i]= malloc(N*sizeof(double)); C[i]= malloc(N*sizeof(double)); } for(i=0; i<M; i++) { for(j=0; j<N; j++) { A[i][j]=rand(); B[i][j]=rand(); C[i][j]=rand(); } } start= omp_get_wtime(); for(i=0; i<M; i++) { for(j=0; j<N; j++) { C[i][j]=A[i][j]+B[i][j]; } } end= omp_get_wtime(); printf("Serial Execution Time: %f\n\n",(end-start)); ////////////////////////////////// start_p= omp_get_wtime(); #pragma omp parallel for for(i=0; i<M; i++) { for(j=0; j<N; j++) { C[i][j]=A[i][j]+B[i][j]; } } end_p= omp_get_wtime(); printf("Parallel Execution Time: %f\n\n",(end_p-start_p)); return 0; }
run
|
edit
|
history
|
help
0
ayudantia ejercicio 2 numero nashee
CS HW2
Static scope
Goodone tricky
FUNCION strstr()
1.2 No. of Threads
swipe the numbers in cyclic way
20171127_ARRAY_ValorMayor
bitwise operations
simple insertion sort