source: CIVL/examples/translation/opencl/square.cvl@ 50f834b

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

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

  • Property mode set to 100644
File size: 641 bytes
Line 
1#include <civlc.h>
2#include <stdio.h>
3#include "setup/openCL.cvl"
4void main()
5{
6 int err;
7 int num_entries = 3;
8
9 cl_device_id device_id;
10 cl_context context;
11 cl_command_queue commands;
12
13 //assumes you have hardware that works, does not check that part
14 err = clGetDeviceIDs(NULL,
15 CL_DEVICE_TYPE_GPU,
16 num_entries,
17 &device_id,
18 NULL);
19 printf("devices is %d", device_id[0]);
20 $assert (err == CL_SUCCESS);
21
22
23 context = clCreateContext(0, 1, &device_id, NULL, NULL, &err);
24 $assert (context != NULL);
25
26 //commands = clCreateCommandQueue(context, device_id, 0, &err);
27 commands = clCreateCommandQueue(context);
28}
Note: See TracBrowser for help on using the repository browser.