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

Diff of /branches/vis12-cl/src/compiler/cl-target/fragments/c-output-grid-fixed.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 23  Line 23 
23      }      }
24    
25    // work sizes for the program    // work sizes for the program
26      size_t globalWorkSize[1];      size_t globalWorkSize[2];
27      size_t localWorkSize[1];      size_t localWorkSize[2];
28      globalWorkSize[0] = wrld->nWorkers * wrld->device->cuWidth;      globalWorkSize[0] = wrld->device->numCUs * wrld->device->cuWidth;
29        globalWorkSize[1] = wrld->nWorkers;
30      localWorkSize[0] = wrld->device->cuWidth;      localWorkSize[0] = wrld->device->cuWidth;
31        localWorkSize[1] = 1;
32    
33    // Run the copy kernel    // Run the copy kernel
34        cl_event copyDoneEvt;
35      if (((sts = clSetKernelArg (kern, 0, sizeof(cl_mem), &(wrld->schedBuf))) != CL_SUCCESS)      if (((sts = clSetKernelArg (kern, 0, sizeof(cl_mem), &(wrld->schedBuf))) != CL_SUCCESS)
36      ||  ((sts = clSetKernelArg (kern, 1, sizeof(cl_mem), &(gpuData))) != CL_SUCCESS)      ||  ((sts = clSetKernelArg (kern, 1, sizeof(cl_mem), &gpuData)) != CL_SUCCESS)
37      ||  ((sts = clSetKernelArg (kern, 2, sizeof(cl_uint), &(wrld->numStrands))) != CL_SUCCESS)      ||  ((sts = clSetKernelArg (kern, 2, sizeof(cl_uint), &(wrld->numStrands))) != CL_SUCCESS)
38      ||  ((sts = clEnqueueNDRangeKernel(wrld->cmdQ, kern, 1, NULL, globalWorkSize, localWorkSize, 0, NULL, NULL)) != CL_SUCCESS)) {      ||  ((sts = clEnqueueNDRangeKernel(wrld->cmdQ, kern, 2, NULL, globalWorkSize, localWorkSize, 0, NULL, &copyDoneEvt)) != CL_SUCCESS)) {
39          ReportOCLError (wrld, sts, "error enqueuing output kernel");          ReportOCLError (wrld, sts, "error enqueuing output kernel");
40          return true;          return true;
41      }      }
# Line 46  Line 49 
49          return true;          return true;
50      }      }
51    
52    //    if ((sts = clFinish (wrld->cmdQ)) != CL_SUCCESS) {
53    //      ReportOCLError (wrld, sts, "error finishing output kernel");
54    //      return true;
55    //    }
56    
57    // copy data to output nrrd    // copy data to output nrrd
58      sts = clEnqueueReadBuffer (wrld->cmdQ, gpuData, CL_TRUE, 0, totalSz, nData->data, 0, 0, 0);      sts = clEnqueueReadBuffer (wrld->cmdQ, gpuData, CL_TRUE, 0, totalSz, nData->data, 1, &copyDoneEvt, 0);
59      if (CheckOCLStatus (wrld, sts, "error copying output from GPU")) {      if (CheckOCLStatus (wrld, sts, "error copying output from GPU")) {
60          clReleaseMemObject(gpuData);          clReleaseMemObject(gpuData);
61          return true;          return true;

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