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 1351, Mon Jun 20 14:48:00 2011 UTC revision 1352, Mon Jun 20 16:42:33 2011 UTC
# Line 237  Line 237 
237      return source;      return source;
238  }  }
239    
240  void clLogMessagesToStderr(const char *errstr, const void *private_info, size_t cb, void *user_data)  static void LogMessagesToStderr (const char *errstr, const void *private_info, size_t cb, void *user_data)
241  {  {
242      fprintf(stderr, "%s\n", errstr);      fprintf(stderr, "%s\n", errstr);
243  }  }
# Line 263  Line 263 
263      }      }
264    
265    // create the context    // create the context
266      cl_context cxt = clCreateContext(0, 1, &dev, clLogMessagesToStderr, 0, &sts);      cl_context cxt = clCreateContext(0, 1, &dev, LogMessagesToStderr, 0, &sts);
267      if (sts != CL_SUCCESS) {      if (sts != CL_SUCCESS) {
268          fprintf (stderr, "error creating OpenCL context\n");          fprintf (stderr, "error creating OpenCL context\n");
269          return false;          return false;
# Line 293  Line 293 
293      const char          *options = "-I " DIDEROT_INCLUDE_PATH;      const char          *options = "-I " DIDEROT_INCLUDE_PATH;
294      sts = clBuildProgram (prog, 1, &dev, options, 0, 0);      sts = clBuildProgram (prog, 1, &dev, options, 0, 0);
295      if (sts != CL_SUCCESS) {      if (sts != CL_SUCCESS) {
296          fprintf (stderr, "error compiling program\n");          size_t logSzb;
297            clGetProgramBuildInfo (prog, dev, CL_PROGRAM_BUILD_LOG, 0, 0, &logSzb);
298            char *log = malloc(logSzb+1);
299            clGetProgramBuildInfo (prog, dev, CL_PROGRAM_BUILD_LOG, logSzb, log, &logSzb);
300            log[logSzb] = '\0';
301            fprintf (stderr, "error compiling program:\n%s\n", log);
302            free (log);
303          return false;          return false;
304      }      }
305    

Legend:
Removed from v.1351  
changed lines
  Added in v.1352

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