1.23
2.0
acw/focus-triggers
main
test-branch
| Line | |
|---|
| 1 | #include <civlc.h>
|
|---|
| 2 | #include <stdio.h>
|
|---|
| 3 | #include "setup/openCL.cvl"
|
|---|
| 4 | void 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.