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

SCM Repository

[diderot] Diff of /branches/vis12-cl/src/compiler/cl-target/fragments/c-main.in
ViewVC logotype

Diff of /branches/vis12-cl/src/compiler/cl-target/fragments/c-main.in

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 3117, Sun Mar 22 08:30:03 2015 UTC revision 3118, Mon Mar 23 18:05:45 2015 UTC
# Line 8  Line 8 
8    
9    // create the world    // create the world
10      @PREFIX@World_t *wrld = @PREFIX@New();      @PREFIX@World_t *wrld = @PREFIX@New();
11      if (wrld == 0)      if (wrld == 0) {
12            fprintf(stderr, "unable to create world\n");
13          exit (1);          exit (1);
14        }
15    
16    // get default OpenCL device    // get default OpenCL device
17      Diderot_DeviceInfo_t *clDevice = Diderot_DefaultCLDevice (wrld->oclInfo);      Diderot_DeviceInfo_t *clDevice = Diderot_DefaultCLDevice (wrld->oclInfo);
# Line 24  Line 26 
26          clDevice->index[0], clDevice->index[1]);          clDevice->index[0], clDevice->index[1]);
27      devName = defaultDevName;      devName = defaultDevName;
28    
   // handle command-line options  
     {  
         Diderot_Options_t *opts = Diderot_OptNew ();  
29  #ifndef DIDEROT_NO_INPUTS  #ifndef DIDEROT_NO_INPUTS
30      // initialize the default values for the inputs
31          @PREFIX@Inputs_t inputs;          @PREFIX@Inputs_t inputs;
32          InitDefaults (&inputs);          InitDefaults (&inputs);
33  #endif  #endif
34    
35      // handle command-line options
36        {
37            Diderot_Options_t *opts = Diderot_OptNew ();
38          Diderot_OptAddFlag (opts, "v,verbose", "enable runtime-system messages", &(wrld->verboseFlg));          Diderot_OptAddFlag (opts, "v,verbose", "enable runtime-system messages", &(wrld->verboseFlg));
39          Diderot_OptAddFlag (opts, "t,timing", "enable execution timing", &timingFlg);          Diderot_OptAddFlag (opts, "t,timing", "enable execution timing", &timingFlg);
40  //      Diderot_OptAddFlag (opts, "T,text", "enable text output", &printOutputFlg);  //      Diderot_OptAddFlag (opts, "T,text", "enable text output", &printOutputFlg);
41            Diderot_OptAddString (opts, "device", "OpenCL device index", &devName, true);
42  #ifndef DIDEROT_NO_INPUTS  #ifndef DIDEROT_NO_INPUTS
43          // register options for setting global inputs
44          RegisterGlobalOpts (&inputs, opts);          RegisterGlobalOpts (&inputs, opts);
45  #endif  #endif
46          RegisterOutputOpts (opts);          RegisterOutputOpts (opts);
# Line 53  Line 59 
59                  exit (1);                  exit (1);
60              }              }
61          }          }
 #ifndef DIDEROT_NO_INPUTS  
       // initialize the input globals  
         if (InitInputs (wrld, &inputs)) {  
             fprintf(stderr, "Error initializing inputs:\n%s\n", biffMsgStrGet(wrld->errors));  
             exit(1);  
         }  
 #endif  
62      }      }
63    
64    // initialize scheduler stuff    // initialize scheduler stuff
# Line 70  Line 69 
69          exit(1);          exit(1);
70      }      }
71    
72    #ifndef DIDEROT_NO_INPUTS
73      // initialize the input globals
74        if (InitInputs (wrld, &inputs)) {
75            fprintf(stderr, "Error initializing inputs:\n%s\n", biffMsgStrGet(wrld->errors));
76            exit(1);
77        }
78    #endif
79    
80    // run the generated global initialization code    // run the generated global initialization code
81      if (wrld->verboseFlg)      if (wrld->verboseFlg)
82          fprintf (stderr, "initializing globals ...\n");          fprintf (stderr, "initializing globals ...\n");

Legend:
Removed from v.3117  
changed lines
  Added in v.3118

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