summaryrefslogtreecommitdiff
path: root/backend/src/driver/cl_gen_driver.h
blob: 82c344e35f7930ac3693f845129397d2010f97ae (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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
/*
 * Copyright © 2012 Intel Corporation
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library. If not, see <http://www.gnu.org/licenses/>.
 *
 */

#ifndef __CL_GEN_DRIVER_H__
#define __CL_GEN_DRIVER_H__
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */

#include <assert.h>
#include "cl_driver.h"

extern _cl_driver clgenDriver;

cl_int GenDriverInit(cl_platform_id platform);
cl_int GenGetDeviceIDs(cl_platform_id platform, cl_device_type device_type,
                       cl_uint num_entries, cl_device_id *devices, cl_uint *num_devices);
cl_int GenCreateContext(cl_context context, const cl_device_id device);
cl_int GenReleaseContext(cl_context context, const cl_device_id device);
cl_int GenCreateCommandQueue(cl_command_queue queue);
cl_int GenReleaseCommandQueue(cl_command_queue queue);
cl_int GenFlushCommandQueue(cl_command_queue queue);
cl_int GenFinishCommandQueue(cl_command_queue queue);
cl_int GenBuildProgram(cl_program program, const cl_device_id device);
cl_int GenGetProgramKernelNames(cl_program program, const cl_device_id device, char *names,
                                cl_uint name_sz, cl_uint* ret_sz, cl_uint* ker_num);
cl_int GenReleaseProgram(cl_program program, const cl_device_id device);
cl_int GenCreateKernel(cl_kernel kernel, const cl_device_id device);
cl_int GenReleaseKernel(cl_kernel kernel, const cl_device_id device);
cl_int GenGetKernelAttr(cl_kernel kernel, const cl_device_id device, cl_uint size, char* attr, cl_uint* ret_sz);
cl_int GenGetKernelArgNum(cl_kernel kernel, const cl_device_id device, cl_uint* ret_num);
cl_int GenGetKernelArgName(cl_kernel kernel, const cl_device_id device, cl_uint index,
                     char *name, cl_uint name_sz, cl_uint* ret_sz);
cl_int GenGetKernelArgTypeName(cl_kernel kernel, const cl_device_id device, cl_uint index,
                     char *name, cl_uint name_sz, cl_uint* ret_sz);
cl_int GenGetKernelArgInfo(cl_kernel kernel, const cl_device_id device, cl_uint index, size_t* size,
                     cl_kernel_arg_type *type, cl_kernel_arg_address_qualifier *qualifier,
                     cl_kernel_arg_access_qualifier *access, cl_kernel_arg_type_qualifier *type_qualifier);
cl_int GenGetKernelWorkgroupInfo(cl_kernel kernel, const cl_device_id device, cl_kernel_workgroup_info wgInfo);
cl_int GenSupportImageFmt(const cl_device_id device, cl_mem_object_type image_type,
                          cl_image_format* image_formats);
cl_int GenCreateBuffer(cl_mem mem, const cl_device_id device);
cl_int GenReleaseMem(cl_mem mem, const cl_device_id device);
cl_int GenEnqueueMapBuffer(cl_command_queue queue, cl_mem mem, void** ret_addr, cl_bool block,
                           cl_map_flags flags, size_t offset, size_t size, cl_command_queue_work_item item);
cl_int GenEnqueueUnmapMem(cl_command_queue queue, cl_mem mem, void *mapped_ptr,
                          cl_uint num_events, const cl_event *event_list, cl_event event_ret);
cl_int GenEnqueueNDRangeKernel(cl_command_queue queue, cl_kernel kernel, const uint32_t work_dim,
                               const size_t *global_wk_off, const size_t *global_wk_sz,
                               const size_t *local_wk_sz, cl_command_queue_work_item item);
cl_int GenEventChanged(cl_event event, cl_command_queue queue, cl_int status);
cl_int GenWaitForEvents(cl_uint num_events, cl_event* events, cl_command_queue queue);

/*****************************************************************************/
int dri2OpenX11(void);
void dri2CloseX11(void);

#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __CL_GEN_DRIVER_H__ */