source: CIVL/examples/translation/openclversion2.1/openCLshared.cvl@ 33ff696

1.23 2.0 acw/focus-triggers main test-branch
Last change on this file since 33ff696 was 141e866, checked in by Jacob Trieu <fuufusuu@…>, 12 years ago

A few methods implemented

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

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