Changeset 6e50a6b for tests/array-container
- Timestamp:
- Jun 18, 2021, 12:20:59 PM (3 years ago)
- Branches:
- ADT, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- c7d8696a
- Parents:
- dcbfcbc
- Location:
- tests/array-container
- Files:
-
- 2 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
tests/array-container/array-basic.cfa
rdcbfcbc r6e50a6b 61 61 forall( [Nw], [Nx], [Ny], [Nz] ) 62 62 void fillHelloData( array( float, Nw, Nx, Ny, Nz ) & wxyz ) { 63 for (w; z(Nw))64 for (x; z(Nx))65 for (y; z(Ny))66 for (z; z(Nz))63 for (w; Nw) 64 for (x; Nx) 65 for (y; Ny) 66 for (z; Nz) 67 67 wxyz[w][x][y][z] = getMagicNumber(w, x, y, z); 68 68 } 69 69 70 forall( [ Zn]70 forall( [N] 71 71 , S & | sized(S) 72 72 ) 73 float total1d_low( arpk( Zn, S, float, float ) & a ) {73 float total1d_low( arpk(N, S, float, float ) & a ) { 74 74 float total = 0.0f; 75 for (i; z(Zn))75 for (i; N) 76 76 total += a[i]; 77 77 return total; … … 98 98 99 99 expect = 0; 100 for (i; z(Nw))100 for (i; Nw) 101 101 expect += getMagicNumber( i, slice_ix, slice_ix, slice_ix ); 102 102 printf("expect Ws = %f\n", expect); … … 117 117 118 118 expect = 0; 119 for (i; z(Nx))119 for (i; Nx) 120 120 expect += getMagicNumber( slice_ix, i, slice_ix, slice_ix ); 121 121 printf("expect Xs = %f\n", expect); -
tests/array-container/array-md-sbscr-cases.cfa
rdcbfcbc r6e50a6b 20 20 forall( [Nw], [Nx], [Ny], [Nz] ) 21 21 void fillHelloData( array( float, Nw, Nx, Ny, Nz ) & wxyz ) { 22 for (w; z(Nw))23 for (x; z(Nx))24 for (y; z(Ny))25 for (z; z(Nz))22 for (w; Nw) 23 for (x; Nx) 24 for (y; Ny) 25 for (z; Nz) 26 26 wxyz[w][x][y][z] = getMagicNumber(w, x, y, z); 27 27 } … … 246 246 assert(( wxyz[[2, 3, 4, 5]] == valExpected )); 247 247 248 for ( i; z(Nw)) {248 for ( i; Nw ) { 249 249 assert(( wxyz[[ i, 3, 4, 5 ]] == getMagicNumber(i, 3, 4, 5) )); 250 250 } 251 251 252 for ( i; z(Nx)) {252 for ( i; Nx ) { 253 253 assert(( wxyz[[ 2, i, 4, 5 ]] == getMagicNumber(2, i, 4, 5) )); 254 254 } 255 255 256 for ( i; z(Ny)) {256 for ( i; Ny ) { 257 257 assert(( wxyz[[ 2, 3, i, 5 ]] == getMagicNumber(2, 3, i, 5) )); 258 258 } 259 259 260 for ( i; z(Nz)) {260 for ( i; Nz ) { 261 261 assert(( wxyz[[ 2, 3, 4, i ]] == getMagicNumber(2, 3, 4, i) )); 262 262 } 263 263 264 for ( i; z(Nw)) {264 for ( i; Nw ) { 265 265 assert(( wxyz[[ i, all, 4, 5 ]][3] == getMagicNumber(i, 3, 4, 5) )); 266 266 } 267 267 268 for ( i; z(Nw)) {268 for ( i; Nw ) { 269 269 assert(( wxyz[[ all, 3, 4, 5 ]][i] == getMagicNumber(i, 3, 4, 5) )); 270 270 }
Note: See TracChangeset
for help on using the changeset viewer.