Ignore:
Timestamp:
Apr 30, 2021, 9:23:12 AM (3 months ago)
Author:
Michael Brooks <mlbrooks@…>
Branches:
arm-eh, jacob/cs343-translation, master
Children:
a049412, ad89296, ec1c674
Parents:
63a4b92
Message:

Activated syntax, forall( [N] ).

This implementation desugars in the parser, as forall( ztype(N) ) did in
the preprocessor. Semantic analysis is still required to lock down treating N as a
a traditional type (forbid: N x = 17; vector(N) v;). Deferring that work until
the N--value adapters ( Z(17), z(N) ) are settled.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tests/array-container/array-md-sbscr-cases.cfa

    r63a4b92 rb9dae14c  
    1818}
    1919
    20 forall( ztype(Nw), ztype(Nx), ztype(Ny), ztype(Nz) )
     20forall( [Nw], [Nx], [Ny], [Nz] )
    2121void fillHelloData( array( float, Nw, Nx, Ny, Nz ) & wxyz ) {
    2222    for (w; z(Nw))
     
    2727}
    2828
    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 
    4729// 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) )
     30forall( [Nw], [Nx], [Ny], [Nz] )
    4931void test_inOrderSplits( tag(Nw), tag(Nx), tag(Ny), tag(Nz) ) {
    5032
     
    9678
    9779// All orders that skip a single dimension, each in its most natural split.
    98 forall( ztype(Nw), ztype(Nx), ztype(Ny), ztype(Nz) )
     80forall( [Nw], [Nx], [Ny], [Nz] )
    9981void test_skipSingle( tag(Nw), tag(Nx), tag(Ny), tag(Nz) ) {
    10082
     
    137119// Natural split means the arity of every -[[-,...]] tuple equals the dimensionality of its "this" operand, then that the fewest "all" subscripts are given.
    138120// 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) )
     121forall( [Nw], [Nx], [Ny], [Nz] )
    140122void test_latticeCoverage( tag(Nw), tag(Nx), tag(Ny), tag(Nz) ) {
    141123
     
    235217}
    236218
    237 forall( ztype(Nw), ztype(Nx), ztype(Ny), ztype(Nz) )
     219forall( [Nw], [Nx], [Ny], [Nz] )
    238220void test_numSubscrTypeCompatibility( tag(Nw), tag(Nx), tag(Ny), tag(Nz) ) {
    239221
     
    282264    test_skipSingle     ( ztag(KW), ztag(KX), ztag(KY), ztag(KZ) );
    283265    test_latticeCoverage( ztag(KW), ztag(KX), ztag(KY), ztag(KZ) );
     266    test_numSubscrTypeCompatibility( ztag(KW), ztag(KX), ztag(KY), ztag(KZ) );
    284267    printf("done\n");
    285268}
Note: See TracChangeset for help on using the changeset viewer.