SCM Repository
Annotation of /trunk/src/include/Diderot/strands.h
Parent Directory
|
Revision Log
Revision 1115 - (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 : | 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 : | } Strand_t; | ||
28 : | |||
29 : | extern int Diderot_NumStrands; // the number of strands in the program | ||
30 : | extern Strand_t *Diderot_Strands[]; // array of NumStrands strand descriptors | ||
31 : | |||
32 : | typedef struct struct_world Diderot_World_t; | ||
33 : | |||
34 : | extern void Diderot_InitGlobals (); | ||
35 : | extern Diderot_World_t *Diderot_Initially (); | ||
36 : | |||
37 : | |||
38 : | /* Diderot library functions */ | ||
39 : | |||
40 : | // block allocation of an initial collection of strands | ||
41 : | extern Diderot_World_t *Diderot_AllocInitially ( | ||
42 : | Strand_t *strand, // the type of strands being allocated | ||
43 : | bool isArray, // is the initialization an array or collection? | ||
44 : | uint32_t nDims, // depth of iteration nesting | ||
45 : | int32_t *base, // nDims array of base indices | ||
46 : | uint32_t *size); // nDims array of iteration sizes | ||
47 : | |||
48 : | // get strand state pointers | ||
49 : | extern void *Diderot_InState (Diderot_World_t *wrld, uint32_t i); | ||
50 : | extern void *Diderot_OutState (Diderot_World_t *wrld, uint32_t i); | ||
51 : | extern bool Diderot_IsActive (Diderot_World_t *wrld, uint32_t i); | ||
52 : | |||
53 : | // strand allocation (no initializtion) | ||
54 : | extern void *Diderot_AllocStrand (Strand_t *strand); | ||
55 : | |||
56 : | #endif /* !_DIDEROT_STRANDS_H_ */ |
root@smlnj-gforge.cs.uchicago.edu | ViewVC Help |
Powered by ViewVC 1.0.0 |