source: CIVL/examples/translation/openclversion2.1/openCLshared.cvl@ 764d472

1.23 2.0 main test-branch
Last change on this file since 764d472 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
RevLine 
[4686c50]1#include "cl.cvl"
2#include <stdio.h>
3#include <stdlib.h>
4#include <string.h>
5
[d508f18]6
[863d90b]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
[141e866]18 clCreateCommandQueue
[863d90b]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
[4686c50]28*/
[1e4e5da]29int clGetDeviceIDs(int numEntries, cl_device_id * devices)
[863d90b]30{
[1e4e5da]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;
[863d90b]36}
[4686c50]37
[141e866]38cl_command_queue clCreateCommandQueue(cl_device_id devices)
39{
40 cl_command_queue queue;
41
42 queue.device = devices;
43
44 return queue;
45}
[d508f18]46//would pick the kernel by name, but not currently in place
[141e866]47
48
49
50
51
52
53
54
Note: See TracBrowser for help on using the repository browser.