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))
8 #define IF_TIME(foo) foo;
12 /* matmul.c 128*128 matrix multiply */
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
++) {
22 ubv
=min(N
-1,32*t3
+31);
25 for (t9
=lbv
;t9
<=ubv
;t9
++) {
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
++) {
40 ubv
=min(N
-1,32*t3
+31);
43 for (t9
=lbv
;t9
<=ubv
;t9
++) {
44 c
[t5
][t9
] = c
[t5
][t9
] + a
[t5
][t6
]*b
[t6
][t9
];