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

1.23 2.0 acw/focus-triggers main test-branch
Last change on this file since b89e408 was 1e4e5da, checked in by Stephen Siegel <siegel@…>, 12 years ago

Cleaned up clGetDeviceIds a little.

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

  • Property mode set to 100644
File size: 674 bytes
RevLine 
[4686c50]1#include "cl.cvl"
2#include <stdio.h>
3#include <stdlib.h>
4#include <string.h>
5
[863d90b]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 clEnqueueNDRangeKernel
18
19workfunc goes into main program, but a method
20
21Methods that will be replaced with simple parts, see wiki:
22 clCreateBuffer
23 setKernelArgs
24 clGetKernelWorkGroupInfo
25 clEnqueueReadBuffer
[4686c50]26*/
[1e4e5da]27int clGetDeviceIDs(int numEntries, cl_device_id * devices)
[863d90b]28{
[1e4e5da]29 for (int i=0; i<numEntries; i++) {
30 devices[i].id = i;
31 // exactly equivalent to: (devices+i)->id = i
32 }
33 return CL_SUCCESS;
[863d90b]34}
[4686c50]35
Note: See TracBrowser for help on using the repository browser.