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 3138, Thu Mar 26 16:27:35 2015 UTC revision 3139, Fri Mar 27 14:03:38 2015 UTC
# Line 30  Line 30 
30      localWorkSize[0] = wrld->device->cuWidth;      localWorkSize[0] = wrld->device->cuWidth;
31      localWorkSize[1] = 1;      localWorkSize[1] = 1;
32    
33        if (wrld->verboseFlg) {
34            fprintf (stderr, "enqueuing output kernel for %d x %d x %d workers and %d strands\n",
35                wrld->device->numCUs, wrld->device->cuWidth, wrld->nWorkers, wrld->numStrands);
36        }
37    
38    // Run the copy kernel    // Run the copy kernel
     cl_event copyDoneEvt;  
39      if (((sts = clSetKernelArg (kern, 0, sizeof(cl_mem), &(wrld->schedBuf))) != CL_SUCCESS)      if (((sts = clSetKernelArg (kern, 0, sizeof(cl_mem), &(wrld->schedBuf))) != CL_SUCCESS)
40      ||  ((sts = clSetKernelArg (kern, 1, sizeof(cl_mem), &gpuData)) != CL_SUCCESS)      ||  ((sts = clSetKernelArg (kern, 1, sizeof(cl_mem), &gpuData)) != CL_SUCCESS)
41      ||  ((sts = clSetKernelArg (kern, 2, sizeof(cl_uint), &(wrld->numStrands))) != CL_SUCCESS)      ||  ((sts = clSetKernelArg (kern, 2, sizeof(cl_uint), &(wrld->numStrands))) != CL_SUCCESS)
42      ||  ((sts = clEnqueueNDRangeKernel(wrld->cmdQ, kern, 2, NULL, globalWorkSize, localWorkSize, 0, NULL, &copyDoneEvt)) != CL_SUCCESS)) {      ||  ((sts = clEnqueueNDRangeKernel(wrld->cmdQ, kern, 2, NULL, globalWorkSize, localWorkSize, 0, NULL, NULL)) != CL_SUCCESS)) {
43          ReportOCLError (wrld, sts, "error enqueuing output kernel");          ReportOCLError (wrld, sts, "error enqueuing output kernel");
44          return true;          return true;
45      }      }
46    
47       if ((sts = clFinish (wrld->cmdQ)) != CL_SUCCESS) {
48            ReportOCLError (wrld, sts, "error finishing output kernel");
49            return true;
50       }
51    
52    // Allocate nData nrrd    // Allocate nData nrrd
53      if (nrrdMaybeAlloc_nva(nData, nrrdType, dim, sizes)!=0) {      if (nrrdMaybeAlloc_nva(nData, nrrdType, dim, sizes)!=0) {
54          char *msg = biffGetDone(NRRD);          char *msg = biffGetDone(NRRD);
# Line 49  Line 58 
58          return true;          return true;
59      }      }
60    
 //    if ((sts = clFinish (wrld->cmdQ)) != CL_SUCCESS) {  
 //      ReportOCLError (wrld, sts, "error finishing output kernel");  
 //      return true;  
 //    }  
   
61    // copy data to output nrrd    // copy data to output nrrd
62      sts = clEnqueueReadBuffer (wrld->cmdQ, gpuData, CL_TRUE, 0, totalSz, nData->data, 1, &copyDoneEvt, 0);      sts = clEnqueueReadBuffer (wrld->cmdQ, gpuData, CL_TRUE, 0, totalSz, nData->data, 0, 0, 0);
63      if (CheckOCLStatus (wrld, sts, "error copying output from GPU")) {      if (CheckOCLStatus (wrld, sts, "error copying output from GPU")) {
64          clReleaseMemObject(gpuData);          clReleaseMemObject(gpuData);
65          return true;          return true;

Legend:
Removed from v.3138  
changed lines
  Added in v.3139

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