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

SCM Repository

[diderot] Annotation of /branches/vis12/src/compiler/c-target/fragments/c-body.in
ViewVC logotype

Annotation of /branches/vis12/src/compiler/c-target/fragments/c-body.in

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1850 - (view) (download)

1 : jhr 1717 /***** Runtime options *****/
2 :    
3 :     //! Set verbose mode
4 :     void @PREFIX@SetVerbose (@PREFIX@World_t *wrld, bool mode)
5 :     {
6 :     wrld->verboseFlg = mode;
7 :     }
8 :    
9 :     //! Get verbose mode
10 :     bool @PREFIX@GetVerbose (@PREFIX@World_t *wrld)
11 :     {
12 :     return wrld->verboseFlg;
13 :     }
14 :    
15 : jhr 1844 #ifdef DIDEROT_TARGET_PARALLEL
16 :    
17 :     //! Set number of workers; 0 means natural number for target (i.e., number of cores)
18 :     void @PREFIX@SetNumWorkers (@PREFIX@World_t *wrld, uint32_t nw)
19 :     {
20 :     if (nw == 0)
21 :     wrld->sched->numWorkers = wrld->sched->cpuInfo.numHWCores;
22 :     else
23 :     wrld->sched->numWorkers = nw;
24 :     }
25 :    
26 :     //! Get number of workers
27 :     uint32_t @PREFIX@GetNumWorkers (@PREFIX@World_t *wrld)
28 :     {
29 :     return wrld->sched->numWorkers;
30 :     }
31 :    
32 :     #endif /* DIDEROT_TARGET_PARALLEL */
33 :    
34 : jhr 1717 /***** World query operations *****/
35 :    
36 :     //! Return the total number of strands (active+stable) in the world
37 :     uint32_t @PREFIX@NumStrands (@PREFIX@World_t *wrld)
38 :     {
39 :     return wrld->numStrands;
40 :     }
41 :    
42 :     //! Return the total number of active strands
43 :     uint32_t @PREFIX@NumActive (@PREFIX@World_t *wrld)
44 :     {
45 : jhr 1850 #if defined(DIDEROT_TARGET_C)
46 :     return wrld->numActive;
47 :     #elif defined(DIDEROT_TARGET_PARALLEL)
48 :     return wrld->sched->numActive;
49 :     #else
50 :     # error bogus target
51 :     #endif
52 : jhr 1717 }
53 :    
54 :     //! Return the total number of stable strands
55 :     uint32_t @PREFIX@NumStable (@PREFIX@World_t *wrld)
56 :     {
57 :     return 0; /* FIXME */
58 :     }

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