source: CIVL/examples/opencl/2.14/possible trash

main
Last change on this file was ea777aa, checked in by Alex Wilton <awilton@…>, 3 years ago

Moved examples, include, build_default.properties, common.xml, and README out from dev.civl.com into the root of the repo.

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

  • Property mode set to 100644
File size: 1.4 KB
RevLine 
[cc87898]1
2//clCreateProgram for each individual one, because the struct args is defined here
3cl_program clCreateProgram(args * argument)
4{
5 cl_program program;
6 program.arguments = argument;
7
8 return program;
9}
10
11/*
12int clSetKernelArg(cl_kernel kernel, int index, size_t size, void * value)
13{
14 if (index == 0)
15 {
16 kernel.program.arguments.input = (int *)malloc(size);
17 }
18
19 return CL_SUCCESS;
20}
21*/
22
23/*
24 Inserts devices based on the number of entries, and unlike the openCL version, is the exact number not the maximum
25 int numEntries - Number of devices to be inputted
26 cl_device_id * devices- pointer to devices
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
37/*
38 Creates a command queue based off of the device inputted, must be called as many times as needed
39 cl_device_id devices - the device to be put into the queue
40*/
41cl_command_queue clCreateCommandQueue(cl_device_id devices)
42{
43 cl_command_queue queue;
44
45 queue.device = devices;
46
47 return queue;
48}
49//would pick the kernel by name, but not currently in place
50
51//example usage of the methods above
52 int err = clGetDeviceIDs(1, &device_id);
53
54 //ignore clCreateContext for now, until we get an example that uses multiple ones
55
56 //clCreateCommandQueue, could use context later
57 commands = clCreateCommandQueue(device_id);
Note: See TracBrowser for help on using the repository browser.