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 1287, Tue Jun 7 13:01:44 2011 UTC revision 1288, Tue Jun 7 13:50:39 2011 UTC
# Line 102  Line 102 
102    
103  }  }
104    
105    /*! \brief build an OpenCL program from source.
106     */
107    static cl_program BuildProgram (cl_device_id dev, cl_context ctx, const char *src)
108    {
109        cl_device_id        devs[1] = { dev };
110        const char          *options = "-I " DIDEROT_INCLUDE_PATH;
111        cl_int              sts;
112    
113        cl_program prog = clCreateProgramWithSource(ctx, 1, &src, NULL, &sts);
114        if (sts != CL_SUCCESS) {
115            fprintf (stderr, "error creating program\n");
116            exit (1);
117        }
118    
119        sts = clBuildProgram (prog, 1, devs, options, 0, 0);
120        if (sts != CL_SUCCESS) {
121            fprintf (stderr, "error compiling program\n");
122            exit (1);
123        }
124    
125        return prog;
126    }
127    
128  /*! \brief load OpenCL code from a file  /*! \brief load OpenCL code from a file
129   */   */
130  char *Diderot_LoadSource (const char *filename)  char *Diderot_LoadSource (const char *filename)

Legend:
Removed from v.1287  
changed lines
  Added in v.1288

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