Added test for osl_loop support
[cloog.git] / test / openscop / loops.c
blobb0bfa880b904c1eb1778018bce82bfe227499e2a
1 /* Useful macros. */
2 #define floord(n,d) (((n)<0) ? -((-(n)+(d)-1)/(d)) : (n)/(d))
3 #define ceild(n,d) (((n)<0) ? -((-(n))/(d)) : ((n)+(d)-1)/(d))
4 #define max(x,y) ((x) > (y) ? (x) : (y))
5 #define min(x,y) ((x) < (y) ? (x) : (y))
7 #ifdef TIME
8 #define IF_TIME(foo) foo;
9 #else
10 #define IF_TIME(foo)
11 #endif
12 /* matmul.c 128*128 matrix multiply */
13 #pragma scop
14 if (N >= 1) {
15 lbp=0;
16 ubp=floord(N-1,32);
17 #pragma omp parallel for private(lbv,ubv)
18 for (t2=lbp;t2<=ubp;t2++) {
19 for (t3=0;t3<=floord(N-1,32);t3++) {
20 for (t4=32*t2;t4<=min(N-1,32*t2+31);t4++) {
21 lbv=32*t3;
22 ubv=min(N-1,32*t3+31);
23 #pragma ivdep
24 #pragma vector always
25 for (t9=lbv;t9<=ubv;t9++) {
26 c[t4][t9] = 0.0;
31 lbp=0;
32 ubp=floord(N-1,32);
33 #pragma omp parallel for private(lbv,ubv)
34 for (t2=lbp;t2<=ubp;t2++) {
35 for (t3=0;t3<=floord(N-1,32);t3++) {
36 for (t4=0;t4<=floord(N-1,32);t4++) {
37 for (t5=32*t2;t5<=min(N-1,32*t2+31);t5++) {
38 for (t6=32*t4;t6<=min(N-1,32*t4+31);t6++) {
39 lbv=32*t3;
40 ubv=min(N-1,32*t3+31);
41 #pragma ivdep
42 #pragma vector always
43 for (t9=lbv;t9<=ubv;t9++) {
44 c[t5][t9] = c[t5][t9] + a[t5][t6]*b[t6][t9];
52 #pragma endscop