summaryrefslogtreecommitdiff
path: root/cl_simple.h
blob: 6bde48ee5c0a7909aa5dc3bc5fbce6e007904127 (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

struct cl_simple_context {
   cl_device_id device_id;
   cl_context cl_ctx;
   cl_command_queue command_queue;
   cl_mem out_buffer;
   cl_kernel kernel;
};

unsigned clSimpleCreateContext(cl_context * context, cl_device_id device_id);
unsigned clSimpleCreateCommandQueue(cl_command_queue * command_queue,
                               cl_context context, cl_device_id device_id);
unsigned clSimpleKernelSetArg(cl_kernel kernel, cl_uint index, size_t size,
                         const void * value);
unsigned clSimpleCreateBuffer(cl_mem * buffer, cl_context context,
                              cl_mem_flags flags, size_t size);
unsigned clSimpleEnqueueNDRangeKernel(cl_command_queue command_queue,
      cl_kernel kernel, cl_uint work_dim, const size_t * global_work_size,
      const size_t * local_work_size);

unsigned clSimpleInitGpuDevice(cl_device_id * device_id);
unsigned clSimpleCreateKernel(cl_context context, cl_device_id device_id,
                         cl_kernel * kernel, const char * kernel_name);
unsigned clSimpleSimpleInit(struct cl_simple_context * context,
                            const char * kernel_name);
unsigned clSimpleSetOutputBuffer(struct cl_simple_context * context,
                                 unsigned buffer_size);
unsigned clSimpleReadOutput(struct cl_simple_context * context, void * data,
      size_t data_bytes);