source: CIVL/examples/translation/openclversion2.1/openCLshared.cvl@ 9e44c01

1.23 2.0 main test-branch
Last change on this file since 9e44c01 was d508f18, checked in by Jacob Trieu <fuufusuu@…>, 12 years ago

Even more methods

git-svn-id: svn://vsl.cis.udel.edu/civl/trunk@1214 fb995dde-84ed-4084-dfe6-e5aef3e2452c

  • Property mode set to 100644
File size: 904 bytes
Line 
1#include "cl.cvl"
2#include <stdio.h>
3#include <stdlib.h>
4#include <string.h>
5
6
7/*
8Defined in cl.cvl: (+ means that it will be used)
9+ cl_device_id
10 cl_context
11+ cl_command_queue
12 cl_program
13 cl_kernel
14? cl_mem
15
16Methods that will be shared:
17 clGetDeviceIDs
18 clCreateCommandQueue
19 clEnqueueNDRangeKernel
20
21workfunc goes into main program, but a method
22
23Methods that will be replaced with simple parts, see wiki:
24 clCreateBuffer
25 setKernelArgs
26 clGetKernelWorkGroupInfo
27 clEnqueueReadBuffer
28*/
29int clGetDeviceIDs(int numEntries, cl_device_id * devices)
30{
31 for (int i=0; i<numEntries; i++) {
32 devices[i].id = i;
33 // exactly equivalent to: (devices+i)->id = i
34 }
35 return CL_SUCCESS;
36}
37
38cl_command_queue clCreateCommandQueue(cl_device_id devices)
39{
40 cl_command_queue queue;
41
42 queue.device = devices;
43
44 return queue;
45}
46//would pick the kernel by name, but not currently in place
47
48
49
50
51
52
53
54
Note: See TracBrowser for help on using the repository browser.