Home My Page Projects Code Snippets Project Openings diderot
Summary Activity Tracker Tasks SCM

SCM Repository

[diderot] Annotation of /trunk/src/include/Diderot/strands.h
ViewVC logotype

Annotation of /trunk/src/include/Diderot/strands.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1444 - (view) (download) (as text)

1 : jhr 1115 /*! \file strands.h
2 :     *
3 :     * \author John Reppy
4 :     */
5 :    
6 :     /*
7 :     * COPYRIGHT (c) 2011 The Diderot Project (http://diderot-language.cs.uchicago.edu)
8 :     * All rights reserved.
9 :     */
10 :    
11 :     #ifndef _DIDEROT_STRANDS_H_
12 :     #define _DIDEROT_STRANDS_H_
13 :    
14 :     #ifndef _DIDEROT_TYPES_H_
15 :     #include "Diderot/types.h"
16 :     #endif
17 :    
18 :     typedef StrandStatus_t (*update_method_t)(void *, void *);
19 :     typedef void (*print_method_t)(FILE *, void *);
20 :    
21 :     /* hooks generated by the compiler for the runtime */
22 :     typedef struct {
23 : jhr 1380 char *name; // name of strand
24 :     size_t stateSzb; // sze of strand state
25 :     update_method_t update; // update method
26 :     print_method_t print; // function for printing output state
27 : jhr 1115 } Strand_t;
28 :    
29 : jhr 1380 extern int Diderot_NumStrands; // the number of strands in the program
30 :     extern Strand_t *Diderot_Strands[]; // array of NumStrands strand descriptors
31 : jhr 1115
32 :     typedef struct struct_world Diderot_World_t;
33 :    
34 : jhr 1301 extern void Diderot_InitGlobals ();
35 :    
36 : jhr 1115 extern Diderot_World_t *Diderot_Initially ();
37 : jhr 1232 extern void Diderot_Shutdown (Diderot_World_t *wrld);
38 : jhr 1115
39 :     /* Diderot library functions */
40 :    
41 :     // block allocation of an initial collection of strands
42 :     extern Diderot_World_t *Diderot_AllocInitially (
43 : jhr 1301 const char *name, // the name of the program
44 : jhr 1380 Strand_t *strand, // the type of strands being allocated
45 :     bool isArray, // is the initialization an array or collection?
46 :     uint32_t nDims, // depth of iteration nesting
47 :     int32_t *base, // nDims array of base indices
48 :     uint32_t *size); // nDims array of iteration sizes
49 : jhr 1115
50 :     // get strand state pointers
51 :     extern void *Diderot_InState (Diderot_World_t *wrld, uint32_t i);
52 :     extern void *Diderot_OutState (Diderot_World_t *wrld, uint32_t i);
53 :     extern bool Diderot_IsActive (Diderot_World_t *wrld, uint32_t i);
54 :    
55 :     // strand allocation (no initializtion)
56 :     extern void *Diderot_AllocStrand (Strand_t *strand);
57 :    
58 :     #endif /* !_DIDEROT_STRANDS_H_ */

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0