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

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

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

  • Property mode set to 100644
File size: 871 bytes
RevLine 
[4686c50]1#include "cl.cvl"
2#include <stdio.h>
3#include <stdlib.h>
4#include <string.h>
5
[2e2a7a5]6/*
7 Inserts devices based on the number of entries, and unlike the openCL version, is the exact number not the maximum
8 int numEntries - Number of devices to be inputted
9 cl_device_id * devices- pointer to devices
10*/
[1e4e5da]11int clGetDeviceIDs(int numEntries, cl_device_id * devices)
[863d90b]12{
[1e4e5da]13 for (int i=0; i<numEntries; i++) {
14 devices[i].id = i;
15 // exactly equivalent to: (devices+i)->id = i
16 }
17 return CL_SUCCESS;
[863d90b]18}
[4686c50]19
[2e2a7a5]20/*
21 Creates a command queue based off of the device inputted, must be called as many times as needed
22 cl_device_id devices - the device to be put into the queue
23*/
[141e866]24cl_command_queue clCreateCommandQueue(cl_device_id devices)
25{
26 cl_command_queue queue;
27
28 queue.device = devices;
29
30 return queue;
31}
[d508f18]32//would pick the kernel by name, but not currently in place
[141e866]33
34
35
36
37
38
39
40
Note: See TracBrowser for help on using the repository browser.