testsuite/libgomp.graphite/force-parallel-7.c

Go to the documentation of this file.
00001 #define N 500
00002 
00003 int foo(void)
00004 {
00005   int i, j, k;
00006   int A[N+5][N+5][N+5];
00007 
00008   /* Loop i: carried no dependency.  */
00009   for (i = 0; i < N; i++)
00010     for (j = 0; j < N; j++)
00011       for (k = 0; k < N; k++)
00012     A[k+1][j+2][i+1] = A[k][j][i+1];
00013 
00014   for (i = 0; i < N; i++)
00015     /* Loop j: carried no dependency.  */
00016     for (j = 0; j < N; j++)
00017       /* Loop k: carreid no dependency.  */
00018       for (k = 0; k < N; k++)
00019     A[i+1][j][k] = A[i][j][k+1];
00020 
00021   return A[1][5][2];
00022 }
00023 
00024 int main(void)
00025 {
00026   foo();
00027 
00028   return 0;
00029 }
00030 
00031 /* Check that parallel code generation part make the right answer.  */
00032 /* { dg-final { scan-tree-dump-times "3 loops carried no dependency" 1 "graphite" } } */
00033 /* { dg-final { cleanup-tree-dump "graphite" } } */
00034 /* { dg-final { scan-tree-dump-times "loopfn.0" 5 "optimized" } } */
00035 /* { dg-final { cleanup-tree-dump "parloops" } } */
00036 /* { dg-final { cleanup-tree-dump "optimized" } } */

Generated on Fri Apr 5 05:38:10 2013 for Libgomp by  doxygen 1.4.7