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

SCM Repository

[diderot] Diff of /branches/pure-cfg/test/probe/probe.c
ViewVC logotype

Diff of /branches/pure-cfg/test/probe/probe.c

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

revision 262, Tue Aug 10 17:35:56 2010 UTC revision 277, Wed Aug 11 21:33:44 2010 UTC
# Line 409  Line 409 
409      assert(err == CL_SUCCESS);      assert(err == CL_SUCCESS);
410    
411      /** Memory Allocation for the Matrices **/      /** Memory Allocation for the Matrices **/
412    int i;
413      for (int i = 0;  i < 4;  i++) {      for ( i = 0;  i < 4;  i++) {
414          h_mem[i] = clCreateBuffer(context,CL_MEM_READ_ONLY,sizeof(float) * 4,NULL,NULL);          h_mem[i] = clCreateBuffer(context,CL_MEM_READ_ONLY,sizeof(float) * 4,NULL,NULL);
415          err |= clEnqueueWriteBuffer(queue,h_mem[i],CL_TRUE,0,sizeof(float) * 4,          err |= clEnqueueWriteBuffer(queue,h_mem[i],CL_TRUE,0,sizeof(float) * 4,
416                                  (void *)h[i] ,0,NULL,NULL);                                  (void *)h[i] ,0,NULL,NULL);
# Line 474  Line 474 
474      err = clEnqueueReadBuffer(queue,out_mem,CL_TRUE,0, sizeof(float) * SIZE,out,0,NULL,NULL);      err = clEnqueueReadBuffer(queue,out_mem,CL_TRUE,0, sizeof(float) * SIZE,out,0,NULL,NULL);
475    
476  //  saveResults(out,SIZE * SIZE);  //  saveResults(out,SIZE * SIZE);
477      printMatrix(out,1);   //   printMatrix(out,1);
478    
479      clReleaseKernel(kernel);      clReleaseKernel(kernel);
480      clReleaseProgram(program);      clReleaseProgram(program);
# Line 482  Line 482 
482      clReleaseContext(context);      clReleaseContext(context);
483    
484      clReleaseMemObject(imageData_mem);      clReleaseMemObject(imageData_mem);
485      for (int i = 0;  i < 4;  i++)      for ( i = 0;  i < 4;  i++)
486          clReleaseMemObject(h_mem[i]);          clReleaseMemObject(h_mem[i]);
487      clReleaseMemObject(out_mem);      clReleaseMemObject(out_mem);
488      clReleaseMemObject(positions_mem);      clReleaseMemObject(positions_mem);
# Line 493  Line 493 
493  {  {
494      //Declaring and initializing input variables      //Declaring and initializing input variables
495      Nrrd * nin;      Nrrd * nin;
496      char * probeValuesFile = "../../data/plane-probe-pos-x.txt";      char * probeValuesFile = "../../data/plane-probe-pos-z.txt";
497      char * dataFile = "../../data/plane-x9.nrrd";      char * dataFile = "../../data/plane-z9.nrrd";
498      float h0[] = {1.33333,  2,  1,  0.166667};          /* -2..-1 */      float h0[] = {1.33333,  2,  1,  0.166667};          /* -2..-1 */
499      float h1[] = {0.666667, 0, -1, -0.5};               /* -1..0 */      float h1[] = {0.666667, 0, -1, -0.5};               /* -1..0 */
500      float h2[] = {0.666667, 0, -1,  0.5};               /* 0..1 */      float h2[] = {0.666667, 0, -1,  0.5};               /* 0..1 */

Legend:
Removed from v.262  
changed lines
  Added in v.277

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