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

Diff of /branches/vis12-cl/src/compiler/cl-target/fragments/c-run.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 7  Line 7 
7  {  {
8      if (maxNSteps == 0) maxNSteps = 0xffffffff;  // essentially unlimited      if (maxNSteps == 0) maxNSteps = 0xffffffff;  // essentially unlimited
9    
10      // work sizes for the program
11        size_t globalWorkSize[2];
12        size_t localWorkSize[2];
13        globalWorkSize[0] = wrld->device->numCUs * wrld->device->cuWidth;
14        globalWorkSize[1] = wrld->nWorkers;
15        localWorkSize[0] = wrld->device->cuWidth;
16        localWorkSize[1] = 1;
17    
18    // iterate until all strands are stable    // iterate until all strands are stable
19      uint32_t nSteps = 0;      uint32_t nSteps = 0;
20      uint32_t nActive = wrld->numActive;      uint32_t nActive = wrld->numActive;
21      while ((nActive > 0) && (nSteps < maxNSteps)) {      while ((nActive > 0) && (nSteps < maxNSteps)) {
22          nSteps++;          nSteps++;
23        // Run the update kernel on all strands        // Run the update kernel on all strands
24          sts = clEnqueueNDRangeKernel(wrld->cmdQ, wrld->UpdateKern, 1, NULL,          sts = clEnqueueNDRangeKernel(wrld->cmdQ, wrld->UpdateKern, 2, NULL,
25                  globalWorkSize, localWorkSize, 0, NULL, NULL);                  globalWorkSize, localWorkSize, 0, NULL, NULL);
26          if (CheckOCLStatus (wrld, sts, "error in executing update kernel"))          if (CheckOCLStatus (wrld, sts, "error in executing update kernel"))
27              return -1;              return -1;
# Line 23  Line 31 
31              return -1;              return -1;
32    
33        // Run the compaction kernel on all strands        // Run the compaction kernel on all strands
34          sts = clEnqueueNDRangeKernel(wrld->cmdQ, wrld->CompactKern, 1, NULL,          sts = clEnqueueNDRangeKernel(wrld->cmdQ, wrld->CompactKern, 2, NULL,
35                  globalWorkSize, localWorkSize, 0, NULL, NULL);                  globalWorkSize, localWorkSize, 0, NULL, NULL);
36          if (CheckOCLStatus (wrld, sts, "error executing compaction kernel"))          if (CheckOCLStatus (wrld, sts, "error executing compaction kernel"))
37              return -1;              return -1;

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