summaryrefslogtreecommitdiff
path: root/backend/src/driver/cl_gen_driver.h
blob: 02a58622711a1ae164f5f817585a67eba1ab44c5 (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
/*
 * 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 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 GenGetArgNum(cl_kernel kernel, const cl_device_id device, cl_uint* ret_num);
cl_int GenGetArgName(cl_kernel kernel, const cl_device_id device, cl_uint index,
                     char *name, cl_uint name_sz, cl_uint* ret_sz);
cl_int GenGetArgTypeName(cl_kernel kernel, const cl_device_id device, cl_uint index,
                     char *name, cl_uint name_sz, cl_uint* ret_sz);
cl_int GenGetArgInfo(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);

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

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