summaryrefslogtreecommitdiff
path: root/util.h
blob: 4d30690a8bc5044c5ed62ca2e097aef5e4be959e (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

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

const char * clTestErrorString(cl_int error);
unsigned clTestInitGpuDevice(cl_device_id * device_id);
unsigned clTestCreateContext(cl_context * context, cl_device_id device_id);
unsigned clTestCreateCommandQueue(cl_command_queue * command_queue,
                               cl_context context, cl_device_id device_id);
unsigned clTestCreateKernel(cl_context context, cl_device_id device_id,
                         cl_kernel * kernel, const char * kernel_name);
unsigned clTestSimpleInit(struct cltest_context * context, const char * kernel_name);
unsigned clTestSetOutputBuffer(struct cltest_context * context, unsigned buffer_size);
unsigned clTestKernelSetArg(cl_kernel kernel, cl_uint index, size_t size,
                         const void * value);
unsigned clTestEnqueueNDRangeKernel(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 clTestReadOutput(struct cltest_context * context, void * data,
      size_t data_bytes);