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 1380 - (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 : jhr 1380
20 :     #if defined(DIDEROT_TARGET_CL)
21 :     typedef void (*print_method_t)(FILE *, uint8_t *, int, void *);
22 :     #else
23 : jhr 1115 typedef void (*print_method_t)(FILE *, void *);
24 : jhr 1380 #endif
25 : jhr 1115
26 :     /* hooks generated by the compiler for the runtime */
27 :     typedef struct {
28 : jhr 1380 char *name; // name of strand
29 :     size_t stateSzb; // sze of strand state
30 :     update_method_t update; // update method
31 :     print_method_t print; // function for printing output state
32 : jhr 1115 } Strand_t;
33 :    
34 : jhr 1380 extern int Diderot_NumStrands; // the number of strands in the program
35 :     extern Strand_t *Diderot_Strands[]; // array of NumStrands strand descriptors
36 : jhr 1115
37 :     typedef struct struct_world Diderot_World_t;
38 :    
39 : jhr 1301 extern void Diderot_InitGlobals ();
40 :    
41 : jhr 1115 extern Diderot_World_t *Diderot_Initially ();
42 : jhr 1232 extern void Diderot_Shutdown (Diderot_World_t *wrld);
43 : jhr 1115
44 :     /* Diderot library functions */
45 :    
46 :     // block allocation of an initial collection of strands
47 :     extern Diderot_World_t *Diderot_AllocInitially (
48 : jhr 1301 const char *name, // the name of the program
49 : jhr 1380 Strand_t *strand, // the type of strands being allocated
50 :     bool isArray, // is the initialization an array or collection?
51 :     uint32_t nDims, // depth of iteration nesting
52 :     int32_t *base, // nDims array of base indices
53 :     uint32_t *size); // nDims array of iteration sizes
54 : jhr 1115
55 :     // get strand state pointers
56 :     extern void *Diderot_InState (Diderot_World_t *wrld, uint32_t i);
57 :     extern void *Diderot_OutState (Diderot_World_t *wrld, uint32_t i);
58 :     extern bool Diderot_IsActive (Diderot_World_t *wrld, uint32_t i);
59 :    
60 :     // strand allocation (no initializtion)
61 :     extern void *Diderot_AllocStrand (Strand_t *strand);
62 :    
63 :     #endif /* !_DIDEROT_STRANDS_H_ */

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