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

SCM Repository

[diderot] Diff of /branches/pure-cfg/src/lib/cl-target/main.c
ViewVC logotype

Diff of /branches/pure-cfg/src/lib/cl-target/main.c

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

revision 1434, Tue Jul 5 22:20:43 2011 UTC revision 1435, Tue Jul 5 23:59:08 2011 UTC
# Line 126  Line 126 
126      double t0 = GetTime();      double t0 = GetTime();
127    
128      size_t globalWorkSize[3] = {0, 0, 0};      size_t globalWorkSize[3] = {0, 0, 0};
129    // QUESTION: why is the local size set to 1?  Does this limit parallelism?
130      size_t localWorkSize[3] = {1, 1, 1};      size_t localWorkSize[3] = {1, 1, 1};
131    
132      if (wrld->nDims == 1) {      if (wrld->nDims == 1) {
# Line 159  Line 160 
160    
161          sts = clSetKernelArg(wrld->kernel, argCount++, sizeof(cl_int), &height);          sts = clSetKernelArg(wrld->kernel, argCount++, sizeof(cl_int), &height);
162          if (sts != CL_SUCCESS) {          if (sts != CL_SUCCESS) {
163              fprintf (stderr, "error Setting OpenCL width argument\n");              fprintf (stderr, "error Setting OpenCL height argument\n");
164              exit(1);              exit(1);
165          }          }
166      }      }
# Line 175  Line 176 
176          fprintf (stderr, "error in executing kernel code: %d\n", sts);          fprintf (stderr, "error in executing kernel code: %d\n", sts);
177          exit(1);          exit(1);
178      }      }
179      clFinish (wrld->cmdQ);      clFinish(wrld->cmdQ);  // QUESTION: is this required?
180    
181      sts = clEnqueueReadBuffer(wrld->cmdQ, stateOutMem, CL_TRUE, 0, wrld->strandSize,      sts = clEnqueueReadBuffer(wrld->cmdQ, stateOutMem, CL_TRUE, 0, wrld->strandSize,
182              wrld->outState, 0, NULL, NULL);              wrld->outState, 0, NULL, NULL);
# Line 187  Line 188 
188      sts = clEnqueueReadBuffer(wrld->cmdQ, statusMem, CL_TRUE, 0, sizeof(uint8_t) * wrld->numStrands,      sts = clEnqueueReadBuffer(wrld->cmdQ, statusMem, CL_TRUE, 0, sizeof(uint8_t) * wrld->numStrands,
189              wrld->status, 0, NULL, NULL);              wrld->status, 0, NULL, NULL);
190      if (sts != CL_SUCCESS) {      if (sts != CL_SUCCESS) {
191              fprintf (stderr, "error in reading back output code: %d\n", sts);              fprintf (stderr, "error in reading back status: %d\n", sts);
192              exit(1);              exit(1);
193      }      }
194      clFinish (wrld->cmdQ);      clFinish (wrld->cmdQ);
# Line 310  Line 311 
311    // build the program    // build the program
312      char options[1024];      char options[1024];
313      snprintf (options, sizeof(options),      snprintf (options, sizeof(options),
314          "-D DIDEROT_CL_VERSION=%d -I %s",          "-D DIDEROT_CL_VERSION=%d -I %s -w",
315          100*dev->majorVersion + dev->minorVersion,          100*dev->majorVersion + dev->minorVersion,
316          DIDEROT_INCLUDE_PATH);          DIDEROT_INCLUDE_PATH);
317      sts = clBuildProgram (prog, 1, &(dev->id), options, 0, 0);      sts = clBuildProgram (prog, 1, &(dev->id), options, 0, 0);
# Line 429  Line 430 
430      assert (i < wrld->numStrands);      assert (i < wrld->numStrands);
431      return !wrld->status[i];      return !wrld->status[i];
432  }  }
433    
434  /***** Support for shadow image values *****/  /***** Support for shadow image values *****/
435    
436  void ShadowImage1D (cl_context cxt, Shadow_image1D_t *dst, Diderot_image1D_t *src)  void ShadowImage1D (cl_context cxt, Shadow_image1D_t *dst, Diderot_image1D_t *src)
437  {  {
438      dst->size[0] = src->size[0];      dst->size[0] = src->size[0];
439      dst->s = src->s;      dst->s = src->s;
440      dst->t = dst->t;      dst->t = dst->t;
   
441  }  }
442    
443  void ShadowImage2D (cl_context cxt, Shadow_image2D_t *dst, Diderot_image2D_t *src)  void ShadowImage2D (cl_context cxt, Shadow_image2D_t *dst, Diderot_image2D_t *src)
444  {  {
445      dst->size[0] = src->size[0];      dst->size[0] = src->size[0];
# Line 444  Line 447 
447      ShadowMat2x2 (dst->w2i, src->w2i);      ShadowMat2x2 (dst->w2i, src->w2i);
448      ShadowVec2 (dst->tVec, src->tVec);      ShadowVec2 (dst->tVec, src->tVec);
449      ShadowMat2x2 (dst->w2iT, src->w2iT);      ShadowMat2x2 (dst->w2iT, src->w2iT);
   
450  }  }
451    
452  void ShadowImage3D (cl_context cxt, Shadow_image3D_t *dst, Diderot_image3D_t *src)  void ShadowImage3D (cl_context cxt, Shadow_image3D_t *dst, Diderot_image3D_t *src)
# Line 455  Line 457 
457      ShadowMat3x3 (dst->w2i, src->w2i);      ShadowMat3x3 (dst->w2i, src->w2i);
458      ShadowVec3 (dst->tVec, src->tVec);      ShadowVec3 (dst->tVec, src->tVec);
459      ShadowMat3x3 (dst->w2iT, src->w2iT);      ShadowMat3x3 (dst->w2iT, src->w2iT);
   
460  }  }

Legend:
Removed from v.1434  
changed lines
  Added in v.1435

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