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

SCM Repository

[diderot] View of /branches/pure-cfg/src/include/Diderot/strands.h
ViewVC logotype

View of /branches/pure-cfg/src/include/Diderot/strands.h

Parent Directory Parent Directory | Revision Log Revision Log

Revision 710 - (download) (as text) (annotate)
Wed Mar 30 16:56:13 2011 UTC (11 years, 3 months ago) by jhr
File size: 1733 byte(s)
  Split up diderot header file into multiple files.
/*! \file strands.h
 * \author John Reppy

 * COPYRIGHT (c) 2011 The Diderot Project (http://diderot-language.cs.uchicago.edu)
 * All rights reserved.


#include "Diderot/types.h"

typedef StrandStatus_t (*update_method_t)(void *, void *);
typedef void (*print_method_t)(FILE *, void *);

/* hooks generated by the compiler for the runtime */
typedef struct {
    char		*name;		// name of strand
    size_t		stateSzb;	// sze of strand state
    update_method_t	update;		// update method
    print_method_t	print;		// function for printing output state
} Strand_t;

extern int Diderot_NumStrands;		// the number of strands in the program
extern Strand_t *Diderot_Strands[];	// array of NumStrands strand descriptors

typedef struct struct_world Diderot_World_t;

extern void Diderot_InitGlobals ();
extern Diderot_World_t *Diderot_Initially ();

/* Diderot library functions */

// block allocation of an initial collection of strands
extern Diderot_World_t *Diderot_AllocInitially (
    Strand_t *strand,		// the type of strands being allocated
    bool isArray,		// is the initialization an array or collection?
    uint32_t nDims,		// depth of iteration nesting
    int32_t *base,		// nDims array of base indices
    uint32_t *size);		// nDims array of iteration sizes

// get strand state pointers
extern void *Diderot_InState (Diderot_World_t *wrld, uint32_t i);
extern void *Diderot_OutState (Diderot_World_t *wrld, uint32_t i);
extern bool Diderot_IsActive (Diderot_World_t *wrld, uint32_t i);

// strand allocation (no initializtion)
extern void *Diderot_AllocStrand (Strand_t *strand);

#endif /* !_DIDEROT_STRANDS_H_ */

ViewVC Help
Powered by ViewVC 1.0.0