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

SCM Repository

[diderot] Diff of /branches/vis12-cl/src/lib/cl-target/ocl-image.c
ViewVC logotype

Diff of /branches/vis12-cl/src/lib/cl-target/ocl-image.c

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

revision 3134, Wed Mar 25 15:47:46 2015 UTC revision 3135, Wed Mar 25 18:31:23 2015 UTC
# Line 59  Line 59 
59      shadow.t = img->t;      shadow.t = img->t;
60    
61    // allocate and initialize GPU-side image object    // allocate and initialize GPU-side image object
62      cl_mem imgObj = clCreateBuffer(wrld->context, CL_MEM_READ_ONLY, sizeof(shadow), &shadow, &sts);      cl_mem imgObj = clCreateBuffer(wrld->context, CL_MEM_READ_ONLY|CL_MEM_COPY_HOST_PTR, sizeof(shadow), &shadow, &sts);
63      if (CheckOCLStatus (wrld, sts, "error allocating GPU memory for image")) {      if (CheckOCLStatus (wrld, sts, "error allocating GPU memory for image")) {
64          Diderot_FreeImage1D((WorldPrefix_t *)wrld, img);          Diderot_FreeImage1D((WorldPrefix_t *)wrld, img);
65          return true;          return true;
66      }      }
67    
68    // allocate and initialize GPU-side image data    // allocate and initialize GPU-side image data
69      cl_mem dataObj = clCreateBuffer(wrld->context, CL_MEM_READ_ONLY, img->dataSzb, img->data, &sts);      cl_mem dataObj = clCreateBuffer(wrld->context, CL_MEM_READ_ONLY|CL_MEM_COPY_HOST_PTR, img->dataSzb, img->data, &sts);
70      if (CheckOCLStatus (wrld, sts, "error allocating GPU memory for image data")) {      if (CheckOCLStatus (wrld, sts, "error allocating GPU memory for image data")) {
71          Diderot_FreeImage1D((WorldPrefix_t *)wrld, img);          Diderot_FreeImage1D((WorldPrefix_t *)wrld, img);
72          clReleaseMemObject(imgObj);          clReleaseMemObject(imgObj);
# Line 129  Line 129 
129      ShadowVec2 (&shadow.tVec, img->tVec);      ShadowVec2 (&shadow.tVec, img->tVec);
130    
131    // allocate and initialize GPU-side image object    // allocate and initialize GPU-side image object
132      cl_mem imgObj = clCreateBuffer(wrld->context, CL_MEM_READ_ONLY, sizeof(shadow), &shadow, &sts);      cl_mem imgObj = clCreateBuffer(wrld->context, CL_MEM_READ_ONLY|CL_MEM_COPY_HOST_PTR, sizeof(shadow), &shadow, &sts);
133      if (CheckOCLStatus (wrld, sts, "error allocating GPU memory for image")) {      if (CheckOCLStatus (wrld, sts, "error allocating GPU memory for image")) {
134          Diderot_FreeImage2D((WorldPrefix_t *)wrld, img);          Diderot_FreeImage2D((WorldPrefix_t *)wrld, img);
135          return true;          return true;
136      }      }
137    
138    // allocate and initialize GPU-side image data    // allocate and initialize GPU-side image data
139      cl_mem dataObj = clCreateBuffer(wrld->context, CL_MEM_READ_ONLY, img->dataSzb, img->data, &sts);      cl_mem dataObj = clCreateBuffer(wrld->context, CL_MEM_READ_ONLY|CL_MEM_COPY_HOST_PTR, img->dataSzb, img->data, &sts);
140      if (CheckOCLStatus (wrld, sts, "error allocating GPU memory for image data")) {      if (CheckOCLStatus (wrld, sts, "error allocating GPU memory for image data")) {
141          Diderot_FreeImage2D((WorldPrefix_t *)wrld, img);          Diderot_FreeImage2D((WorldPrefix_t *)wrld, img);
142          clReleaseMemObject(imgObj);          clReleaseMemObject(imgObj);
# Line 199  Line 199 
199      ShadowVec3 (&shadow.tVec, img->tVec);      ShadowVec3 (&shadow.tVec, img->tVec);
200    
201    // allocate and initialize GPU-side image object    // allocate and initialize GPU-side image object
202      cl_mem imgObj = clCreateBuffer(wrld->context, CL_MEM_READ_ONLY, sizeof(shadow), &shadow, &sts);      cl_mem imgObj = clCreateBuffer(wrld->context, CL_MEM_READ_ONLY|CL_MEM_COPY_HOST_PTR, sizeof(shadow), &shadow, &sts);
203      if (CheckOCLStatus (wrld, sts, "error allocating GPU memory for image")) {      if (CheckOCLStatus (wrld, sts, "error allocating GPU memory for image")) {
204          Diderot_FreeImage3D((WorldPrefix_t *)wrld, img);          Diderot_FreeImage3D((WorldPrefix_t *)wrld, img);
205          return true;          return true;
206      }      }
207    
208    // allocate and initialize GPU-side image data    // allocate and initialize GPU-side image data
209      cl_mem dataObj = clCreateBuffer(wrld->context, CL_MEM_READ_ONLY, img->dataSzb, img->data, &sts);      cl_mem dataObj = clCreateBuffer(wrld->context, CL_MEM_READ_ONLY|CL_MEM_COPY_HOST_PTR, img->dataSzb, img->data, &sts);
210      if (CheckOCLStatus (wrld, sts, "error allocating GPU memory for image data")) {      if (CheckOCLStatus (wrld, sts, "error allocating GPU memory for image data")) {
211          Diderot_FreeImage3D((WorldPrefix_t *)wrld, img);          Diderot_FreeImage3D((WorldPrefix_t *)wrld, img);
212          clReleaseMemObject(imgObj);          clReleaseMemObject(imgObj);

Legend:
Removed from v.3134  
changed lines
  Added in v.3135

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