1 Description: Move cl_intel_accelerator to cl_intel.h
3 Beignet's own headers define cl_intel_accelerator etc directly in
4 cl_ext.h, but khronos-opencl-headers 2.2~ places these in a separate
5 file cl_ext_intel.h, and older versions do not include it at all.
7 Author: Rebecca N. Palmer <rebecca_palmer@zoho.com>
8 Forwarded: https://lists.freedesktop.org/archives/beignet/2018-July/009217.html
10 --- a/include/CL/cl_intel.h
11 +++ b/include/CL/cl_intel.h
16 +#if defined(__CL_EXT_H) && !defined(cl_intel_accelerator)
17 +#ifdef CL_VERSION_2_2
18 +#include "CL/cl_ext_intel.h"
20 +/*********************************
21 +* cl_intel_accelerator extension *
22 +*********************************/
23 +#define cl_intel_accelerator 1
24 +#define cl_intel_motion_estimation 1
26 +typedef struct _cl_accelerator_intel* cl_accelerator_intel;
27 +typedef cl_uint cl_accelerator_type_intel;
28 +typedef cl_uint cl_accelerator_info_intel;
30 +typedef struct _cl_motion_estimation_desc_intel {
31 + cl_uint mb_block_type;
32 + cl_uint subpixel_mode;
33 + cl_uint sad_adjust_mode;
34 + cl_uint search_path_type;
35 +} cl_motion_estimation_desc_intel;
38 +#define CL_INVALID_ACCELERATOR_INTEL -1094
39 +#define CL_INVALID_ACCELERATOR_TYPE_INTEL -1095
40 +#define CL_INVALID_ACCELERATOR_DESCRIPTOR_INTEL -1096
41 +#define CL_ACCELERATOR_TYPE_NOT_SUPPORTED_INTEL -1097
43 +/* Deprecated Error Codes */
44 +#define CL_INVALID_ACCELERATOR_INTEL_DEPRECATED -6000
45 +#define CL_INVALID_ACCELERATOR_TYPE_INTEL_DEPRECATED -6001
46 +#define CL_INVALID_ACCELERATOR_DESCRIPTOR_INTEL_DEPRECATED -6002
47 +#define CL_ACCELERATOR_TYPE_NOT_SUPPORTED_INTEL_DEPRECATED -6003
49 +/* cl_accelerator_type_intel */
50 +#define CL_ACCELERATOR_TYPE_MOTION_ESTIMATION_INTEL 0x0
52 +/* cl_accelerator_info_intel */
53 +#define CL_ACCELERATOR_DESCRIPTOR_INTEL 0x4090
54 +#define CL_ACCELERATOR_REFERENCE_COUNT_INTEL 0x4091
55 +#define CL_ACCELERATOR_CONTEXT_INTEL 0x4092
56 +#define CL_ACCELERATOR_TYPE_INTEL 0x4093
58 +/*cl_motion_detect_desc_intel flags */
59 +#define CL_ME_MB_TYPE_16x16_INTEL 0x0
60 +#define CL_ME_MB_TYPE_8x8_INTEL 0x1
61 +#define CL_ME_MB_TYPE_4x4_INTEL 0x2
63 +#define CL_ME_SUBPIXEL_MODE_INTEGER_INTEL 0x0
64 +#define CL_ME_SUBPIXEL_MODE_HPEL_INTEL 0x1
65 +#define CL_ME_SUBPIXEL_MODE_QPEL_INTEL 0x2
67 +#define CL_ME_SAD_ADJUST_MODE_NONE_INTEL 0x0
68 +#define CL_ME_SAD_ADJUST_MODE_HAAR_INTEL 0x1
70 +#define CL_ME_SEARCH_PATH_RADIUS_2_2_INTEL 0x0
71 +#define CL_ME_SEARCH_PATH_RADIUS_4_4_INTEL 0x1
72 +#define CL_ME_SEARCH_PATH_RADIUS_16_12_INTEL 0x5
74 +extern CL_API_ENTRY cl_accelerator_intel CL_API_CALL
75 +clCreateAcceleratorINTEL(
76 + cl_context /* context */,
77 + cl_accelerator_type_intel /* accelerator_type */,
78 + size_t /* descriptor_size */,
79 + const void* /* descriptor */,
80 + cl_int* /* errcode_ret */ ) CL_EXT_SUFFIX__VERSION_1_2;
82 +typedef CL_API_ENTRY cl_accelerator_intel
83 + (CL_API_CALL *clCreateAcceleratorINTEL_fn)(
84 + cl_context /* context */,
85 + cl_accelerator_type_intel /* accelerator_type */,
86 + size_t /* descriptor_size */,
87 + const void* /* descriptor */,
88 + cl_int* /* errcode_ret */ ) CL_EXT_SUFFIX__VERSION_1_2;
90 +extern CL_API_ENTRY cl_int CL_API_CALL
91 +clGetAcceleratorInfoINTEL
93 + cl_accelerator_intel /* accelerator */,
94 + cl_accelerator_info_intel /* param_name */,
95 + size_t /* param_value_size */,
96 + void* /* param_value */,
97 + size_t* /* param_value_size_ret */ ) CL_EXT_SUFFIX__VERSION_1_2;
99 +typedef CL_API_ENTRY cl_int
100 + (CL_API_CALL *clGetAcceleratorInfoINTEL_fn)(
101 + cl_accelerator_intel /* accelerator */,
102 + cl_accelerator_info_intel /* param_name */,
103 + size_t /* param_value_size */,
104 + void* /* param_value */,
105 + size_t* /* param_value_size_ret */ ) CL_EXT_SUFFIX__VERSION_1_2;
107 +extern CL_API_ENTRY cl_int CL_API_CALL
108 +clRetainAcceleratorINTEL(
109 + cl_accelerator_intel /* accelerator */ ) CL_EXT_SUFFIX__VERSION_1_2;
111 +typedef CL_API_ENTRY cl_int
112 + (CL_API_CALL *clRetainAcceleratorINTEL_fn)(
113 + cl_accelerator_intel /* accelerator */ ) CL_EXT_SUFFIX__VERSION_1_2;
115 +extern CL_API_ENTRY cl_int CL_API_CALL
116 +clReleaseAcceleratorINTEL(
117 + cl_accelerator_intel /* accelerator */ ) CL_EXT_SUFFIX__VERSION_1_2;
119 +typedef CL_API_ENTRY cl_int
120 + (CL_API_CALL *clReleaseAcceleratorINTEL_fn)(
121 + cl_accelerator_intel /* accelerator */ ) CL_EXT_SUFFIX__VERSION_1_2;
125 #define CL_MEM_PINNABLE (1 << 10)
127 /* Track allocations and report current number of unfreed allocations */
128 --- a/src/cl_accelerator_intel.h
129 +++ b/src/cl_accelerator_intel.h
131 #include "cl_base_object.h"
133 #include "CL/cl_ext.h"
134 +#include "CL/cl_intel.h"
137 struct _cl_accelerator_intel {
138 --- a/src/cl_driver.h
139 +++ b/src/cl_driver.h
142 #include "cl_driver_type.h"
143 #include "CL/cl_ext.h"
144 +#include "CL/cl_intel.h"
145 /* Various limitations we should remove actually */
146 #define GEN_MAX_SURFACES 256
147 #define GEN_MAX_SAMPLERS 16