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-run-nobsp.in
ViewVC logotype

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

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

revision 3136, Wed Mar 25 18:33:59 2015 UTC revision 3137, Thu Mar 26 14:55:52 2015 UTC
# Line 13  Line 13 
13    
14      double t0 = airTime();      double t0 = airTime();
15    
16    // run the program    // work sizes for the program
17      size_t globalWorkSize[1];      size_t globalWorkSize[2];
18      size_t localWorkSize[1];      size_t localWorkSize[2];
19      globalWorkSize[0] = wrld->nWorkers * wrld->device->cuWidth;      globalWorkSize[0] = wrld->device->numCUs * wrld->device->cuWidth;
20        globalWorkSize[1] = wrld->nWorkers;
21      localWorkSize[0] = wrld->device->cuWidth;      localWorkSize[0] = wrld->device->cuWidth;
22        localWorkSize[1] = 1;
23    
24      if (wrld->verboseFlg) {      if (wrld->verboseFlg) {
25          fprintf (stderr, "enqueuing UpdateKern for %d x %d workers\n",          fprintf (stderr, "enqueuing UpdateKern for %d x %d x %d workers\n",
26              wrld->nWorkers, wrld->device->cuWidth);              wrld->device->numCUs, wrld->device->cuWidth, wrld->nWorkers);
27      }      }
28    
29      if (((sts = clSetKernelArg (wrld->UpdateKern, 0, sizeof(cl_mem), &(wrld->schedBuf))) != CL_SUCCESS)      if (((sts = clSetKernelArg (wrld->UpdateKern, 0, sizeof(cl_mem), &(wrld->schedBuf))) != CL_SUCCESS)
30      ||  ((sts = clSetKernelArg (wrld->UpdateKern, 1, sizeof(cl_mem), &(wrld->globalsBuf))) != CL_SUCCESS)      ||  ((sts = clSetKernelArg (wrld->UpdateKern, 1, sizeof(cl_mem), &(wrld->globalsBuf))) != CL_SUCCESS)
31      ||  ((sts = clSetKernelArg (wrld->UpdateKern, 2, sizeof(cl_int), &nSteps)) != CL_SUCCESS)      ||  ((sts = clSetKernelArg (wrld->UpdateKern, 2, sizeof(cl_int), &nSteps)) != CL_SUCCESS)
32      ||  ((sts = clEnqueueNDRangeKernel(wrld->cmdQ, wrld->UpdateKern, 1, NULL, globalWorkSize, localWorkSize, 0, NULL, NULL)) != CL_SUCCESS)) {      ||  ((sts = clEnqueueNDRangeKernel(wrld->cmdQ, wrld->UpdateKern, 2, NULL, globalWorkSize, localWorkSize, 0, NULL, NULL)) != CL_SUCCESS)) {
33          ReportOCLError (wrld, sts, "error enqueuing UpdateKern kernel");          ReportOCLError (wrld, sts, "error enqueuing UpdateKern kernel");
34          return 0;          return 0;
35      }      }
# Line 60  Line 62 
62          exit(1);          exit(1);
63      }      }
64    
65        if (wrld->verboseFlg) {
66            fprintf(stderr, "Run finished with %d active + %d stable = %d strands\n",
67                schedInfo.nActive, schedInfo.nStable, schedInfo.nStrands);
68        }
69    
70      return schedInfo.nSteps;      return schedInfo.nSteps;
71    
72  } // @PREFIX@Run  } // @PREFIX@Run

Legend:
Removed from v.3136  
changed lines
  Added in v.3137

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