- Timestamp:
- Apr 30, 2021, 9:23:12 AM (4 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- a049412, ad89296, ec1c674
- Parents:
- 63a4b92
- Location:
- tests/array-container
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
tests/array-container/array-basic.cfa
r63a4b92 rb9dae14c 5 5 // 6 6 7 forall( ztype(Nx), ztype(Ny), ztype(Nz))7 forall( [Nx], [Ny], [Nz] ) 8 8 void typesTest( tag(Nx), tag(Ny), tag(Nz) ) { 9 9 … … 59 59 } 60 60 61 forall( ztype(Nw), ztype(Nx), ztype(Ny), ztype(Nz))61 forall( [Nw], [Nx], [Ny], [Nz] ) 62 62 void fillHelloData( array( float, Nw, Nx, Ny, Nz ) & wxyz ) { 63 63 for (w; z(Nw)) … … 68 68 } 69 69 70 forall( ztype(Zn)70 forall( [Zn] 71 71 , S & | sized(S) 72 72 ) … … 86 86 } 87 87 88 forall( ztype(Nw), ztype(Nx), ztype(Ny), ztype(Nz))88 forall( [Nw], [Nx], [Ny], [Nz] ) 89 89 void runtimeTest( tag(Nw), tag(Nx), tag(Ny), tag(Nz) ) { 90 90 -
tests/array-container/array-md-sbscr-cases.cfa
r63a4b92 rb9dae14c 18 18 } 19 19 20 forall( ztype(Nw), ztype(Nx), ztype(Ny), ztype(Nz))20 forall( [Nw], [Nx], [Ny], [Nz] ) 21 21 void fillHelloData( array( float, Nw, Nx, Ny, Nz ) & wxyz ) { 22 22 for (w; z(Nw)) … … 27 27 } 28 28 29 forall( ztype(Zn)30 , S & | sized(S)31 )32 float total1d_low( arpk(Zn, S, float, float ) & a ) {33 float total = 0.0f;34 for (i; z(Zn))35 total += a[i];36 return total;37 }38 39 forall( A & | ar(A, float) )40 float total1d_hi( A & a ) {41 float total = 0.0f;42 for (i; a`len)43 total += a[i];44 return total;45 }46 47 29 // Tests all the ways to split dimensions into CFA-supported chunks, by the only order that C supports: coarsest to finest stride. 48 forall( ztype(Nw), ztype(Nx), ztype(Ny), ztype(Nz))30 forall( [Nw], [Nx], [Ny], [Nz] ) 49 31 void test_inOrderSplits( tag(Nw), tag(Nx), tag(Ny), tag(Nz) ) { 50 32 … … 96 78 97 79 // All orders that skip a single dimension, each in its most natural split. 98 forall( ztype(Nw), ztype(Nx), ztype(Ny), ztype(Nz))80 forall( [Nw], [Nx], [Ny], [Nz] ) 99 81 void test_skipSingle( tag(Nw), tag(Nx), tag(Ny), tag(Nz) ) { 100 82 … … 137 119 // Natural split means the arity of every -[[-,...]] tuple equals the dimensionality of its "this" operand, then that the fewest "all" subscripts are given. 138 120 // The commented-out test code shows cases that don't work. We wish all the comment-coverd cases worked. 139 forall( ztype(Nw), ztype(Nx), ztype(Ny), ztype(Nz))121 forall( [Nw], [Nx], [Ny], [Nz] ) 140 122 void test_latticeCoverage( tag(Nw), tag(Nx), tag(Ny), tag(Nz) ) { 141 123 … … 235 217 } 236 218 237 forall( ztype(Nw), ztype(Nx), ztype(Ny), ztype(Nz))219 forall( [Nw], [Nx], [Ny], [Nz] ) 238 220 void test_numSubscrTypeCompatibility( tag(Nw), tag(Nx), tag(Ny), tag(Nz) ) { 239 221 … … 282 264 test_skipSingle ( ztag(KW), ztag(KX), ztag(KY), ztag(KZ) ); 283 265 test_latticeCoverage( ztag(KW), ztag(KX), ztag(KY), ztag(KZ) ); 266 test_numSubscrTypeCompatibility( ztag(KW), ztag(KX), ztag(KY), ztag(KZ) ); 284 267 printf("done\n"); 285 268 }
Note:
See TracChangeset
for help on using the changeset viewer.