| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-require-effective-target size32plus } */ |
| 3 |
/* { dg-additional-options "-march=core-avx2" { target { x86_64-*-* i?86-*-* } } } */ |
| 4 |
/* { dg-require-effective-target size32plus } */ |
| 5 |
|
| 6 |
typedef enum { |
| 7 |
C = 0, N, S, E, W, T, B, NE, NW, SE, SW, NT, NB, ST, SB, ET, EB, WT, WB, FLAGS, N_CELL_ENTRIES} CELL_ENTRIES; |
| 8 |
typedef double LBM_Grid[(130)*100*100*N_CELL_ENTRIES]; |
| 9 |
void foo( LBM_Grid srcGrid ) |
| 10 |
{ |
| 11 |
double ux , uy , uz , rho , ux1, uy1, uz1, rho1, ux2, uy2, uz2, rho2, u2, px, py; |
| 12 |
int i; |
| 13 |
for( i = 0; |
| 14 |
i < (N_CELL_ENTRIES*( 100*100)); |
| 15 |
i += N_CELL_ENTRIES ) |
| 16 |
{ |
| 17 |
rho1 = + ((srcGrid)[((C)+N_CELL_ENTRIES*( 100*100))+(i)]) |
| 18 |
+ ((srcGrid)[((N)+N_CELL_ENTRIES*( 100*100))+(i)]) |
| 19 |
+ ((srcGrid)[((S)+N_CELL_ENTRIES*( 100*100))+(i)]) |
| 20 |
+ ((srcGrid)[((E)+N_CELL_ENTRIES*( 100*100))+(i)]) |
| 21 |
+ ((srcGrid)[((W)+N_CELL_ENTRIES*( 100*100))+(i)]) |
| 22 |
+ ((srcGrid)[((T)+N_CELL_ENTRIES*( 100*100))+(i)]) |
| 23 |
+ ((srcGrid)[((B)+N_CELL_ENTRIES*( 100*100))+(i)]) |
| 24 |
+ ((srcGrid)[((NE)+N_CELL_ENTRIES*( 100*100))+(i)]) |
| 25 |
+ ((srcGrid)[((NW)+N_CELL_ENTRIES*( 100*100))+(i)]) |
| 26 |
+ ((srcGrid)[((SE)+N_CELL_ENTRIES*( 100*100))+(i)]) |
| 27 |
+ ((srcGrid)[((SW)+N_CELL_ENTRIES*( 100*100))+(i)]) |
| 28 |
+ ((srcGrid)[((NT)+N_CELL_ENTRIES*( 100*100))+(i)]) |
| 29 |
+ ((srcGrid)[((NB)+N_CELL_ENTRIES*( 100*100))+(i)]) |
| 30 |
+ ((srcGrid)[((ST)+N_CELL_ENTRIES*( 100*100))+(i)]) |
| 31 |
+ ((srcGrid)[((SB)+N_CELL_ENTRIES*( 100*100))+(i)]) |
| 32 |
+ ((srcGrid)[((ET)+N_CELL_ENTRIES*( 100*100))+(i)]) |
| 33 |
+ ((srcGrid)[((EB)+N_CELL_ENTRIES*( 100*100))+(i)]) |
| 34 |
+ ((srcGrid)[((WT)+N_CELL_ENTRIES*( 100*100))+(i)]) |
| 35 |
+ ((srcGrid)[((WB)+N_CELL_ENTRIES*( 100*100))+(i)]); |
| 36 |
rho = 2.0*rho1 - rho2; |
| 37 |
px = (((i / N_CELL_ENTRIES) % 100) / (0.5*(100-1))) - 1.0; |
| 38 |
uz = 0.01 * (1.0-px*px) * (1.0-py*py); |
| 39 |
u2 = 1.5 * (ux*ux + uy*uy + uz*uz); |
| 40 |
(((srcGrid)[((C))+(i)])) = (1.0/ 3.0)*rho*(1.0 - u2); |
| 41 |
(((srcGrid)[((N))+(i)])) = (1.0/18.0)*rho*(1.0 + uy*(4.5*uy + 3.0) - u2); |
| 42 |
} |
| 43 |
} |