blob: f9a5170ac904ead9a88330091d47398dc58b6f93 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
#include <stdio.h>
#include <stdlib.h>
#include <CL/cl.h>
#include "cl_simple.h"
int main(int argc, char ** argv)
{
cl_int error;
struct cl_simple_context context;
unsigned i;
int out_data[10];
size_t global_work_size = 10;
clSimpleSimpleInit(&context, "global_id");
clSimpleSetOutputBuffer(&context, sizeof(out_data));
clSimpleEnqueueNDRangeKernel(context.command_queue,
context.kernel,
1, &global_work_size, &global_work_size);
clSimpleReadOutput(&context, out_data, sizeof(out_data));
for (i = 0; i < 10; i++) {
fprintf(stderr, "id %u = %u\n", i, out_data[i]);
}
}
|