#include "cl.cvl" #include #include #include /* Defined in cl.cvl: (+ means that it will be used) + cl_device_id cl_context + cl_command_queue cl_program cl_kernel ? cl_mem Methods that will be shared: clGetDeviceIDs clCreateCommandQueue clEnqueueNDRangeKernel workfunc goes into main program, but a method Methods that will be replaced with simple parts, see wiki: clCreateBuffer setKernelArgs clGetKernelWorkGroupInfo clEnqueueReadBuffer */ int clGetDeviceIDs(int numEntries, cl_device_id * devices) { for (int i=0; iid = i } return CL_SUCCESS; } cl_command_queue clCreateCommandQueue(cl_device_id devices) { cl_command_queue queue; queue.device = devices; return queue; } //would pick the kernel by name, but not currently in place