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

SCM Repository

[diderot] Annotation of /branches/vis12/src/include/Diderot/world.h
ViewVC logotype

Annotation of /branches/vis12/src/include/Diderot/world.h

Parent Directory Parent Directory | Revision Log Revision Log


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

1 : jhr 1640 /*! \file world.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_WORLD_H_
12 :     #define _DIDEROT_WORLD_H_
13 :    
14 :     #ifndef _DIDEROT_TYPES_H_
15 :     #include "types.h"
16 :     #endif
17 :    
18 :     typedef struct struct_world Diderot_World_t;
19 :    
20 :     //! the integer typed used to represent the strand status array.
21 :     #if defined(DIDEROT_TARGET_CL)
22 :     typedef uint32_t StatusInt_t;
23 :     #else
24 :     typedef uint8_t StatusInt_t;
25 :     #endif
26 :    
27 :     /* The World_t structure type varies across targets, but all targets share the same prefix. */
28 :     #define STRUCT_WORLD_PREFIX \
29 :     const char *name; /*!< the program name */ \
30 : jhr 1714 bool isArray; /*!< are the strands in an array or collection? */ \
31 :     int32_t nStrandTys; /*!< number of strand types in the program. */ \
32 :     Strand_t *strandDesc; /*!< nStrandTys array of strand descriptors */ \
33 : jhr 1640 uint32_t nDims; /*!< depth of iteration nesting */ \
34 :     int32_t *base; /*!< nDims array of base indices */ \
35 :     uint32_t *size; /*!< nDims array of iteration sizes */ \
36 :     uint32_t numStrands; /*!< number of strands in the world */ \
37 :     size_t outputSzb; /*!< the output size of the strands */ \
38 :     StatusInt_t *status; /*!< array of strand status flags */
39 :    
40 :     /*! \brief a structure type for accessing the common fields of a world. */
41 :     typedef struct {
42 :     STRUCT_WORLD_PREFIX
43 :     } WorldPrefix_t;
44 :    
45 :     /*! \brief get the strand in state.
46 :     * \param wrld the world pointer.
47 :     * \param i the strand index
48 :     * \return a pointer to the strand's state.
49 :     */
50 :     extern void *Diderot_InState (Diderot_World_t *wrld, uint32_t i);
51 :    
52 :     /*! \brief get the strand out state.
53 :     * \param wrld the world pointer.
54 :     * \param i the strand index
55 :     * \return a pointer to the strand's state.
56 :     */
57 :     extern void *Diderot_OutState (Diderot_World_t *wrld, uint32_t i);
58 :    
59 :     /*! \brief is a strand active?
60 :     * \param wrld the world pointer.
61 :     * \param i the strand index
62 :     * \return true if the strand is active.
63 :     */
64 :     STATIC_INLINE bool Diderot_IsActive (Diderot_World_t *wrld, uint32_t i)
65 :     {
66 :     WorldPrefix_t *hdr = (WorldPrefix_t *)wrld;
67 :     assert (i < hdr->numStrands);
68 :     return !hdr->status[i];
69 :     }
70 :    
71 :     #endif /* !_DIDEROT_WORLD_H_ */

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