#include <omp.h> #include <stdio.h> int main (int argc, char *argv[]) { int i; int A[128], B[128],C[128] ; for( i=0;i<128;i++) {C[i]=0;A[i]=3;B[i]=2 ;} omp_set_num_thread (4); #pragma omp parallel { int id; id = omp_get_thread_num(); for (i =id*8 ; i<(id+1)*8 ; i++) C[i] = A[i]+ B[i] ; } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)