// // gcc -lm -fopenmp demoOMP.c // #include #include // int main(void) { int rgb[HIGHT][WIDTH][3] ; int y , x ; FILE* fout ; // init() ; // for( y = 0 ; y < HIGHT ; y++ ) { #pragma omp parallel for private(x) for( x = 0 ; x < WIDTH ; x++) { getcolor( y , x , rgb[y][x] ) ; } } // fout = fopen( "out.ppm" , "w" ) ; fprintf( fout , "P3\n" ) ; fprintf( fout , "%d %d\n" , WIDTH , HIGHT ) ; fprintf( fout , "255\n" ) ; for( y = 0 ; y < HIGHT ; y++ ) { for( x = 0 ; x < WIDTH ; x++) { fprintf( fout , "%d %d %d\n" , rgb[y][x][0] , rgb[y][x][1] , rgb[y][x][2] ) ; } } close( fout ) ; return 0 ; } // // end of file //