- Timestamp:
- Mar 10, 2024, 11:21:18 AM (6 months ago)
- Branches:
- master
- Children:
- 9398177
- Parents:
- b64d0f4
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/theses/mike_brooks_MMath/programs/hello-accordion.cfa
rb64d0f4 r5546f50b 11 11 forall( T, [Nclients], [Ncosts] ) 12 12 struct request { 13 14 15 16 13 unsigned int requestor_id; 14 array( T, Nclients ) impacted_client_ids; // nested VLA 15 array( float, Ncosts ) cost_contribs; // nested VLA 16 float total_cost; 17 17 }; 18 18 … … 41 41 forall( T, [Nclients], [Ncosts] ) 42 42 void summarize( request( T, Nclients, Ncosts ) & r ) { 43 44 45 46 47 43 r.total_cost = 0; 44 for( i; Ncosts ) 45 r.total_cost += r.cost_contribs[i]; 46 // say the cost is per-client, to make output vary 47 r.total_cost *= Nclients; 48 48 } 49 49
Note: See TracChangeset
for help on using the changeset viewer.