This file is indexed.

/usr/lib/x86_64-linux-gnu/beignet/include/ocl_common.h is in beignet-opencl-icd 1.3.2-2.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  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
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
/*
 * Copyright © 2012 - 2014 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 __OCL_COMMON_H__
#define __OCL_COMMON_H__

#include "ocl_types.h"

/////////////////////////////////////////////////////////////////////////////
// Common Functions
/////////////////////////////////////////////////////////////////////////////
OVERLOADABLE float step(float edge, float x);
OVERLOADABLE float max(float a, float b);
OVERLOADABLE float min(float a, float b);
OVERLOADABLE float mix(float x, float y, float a);
OVERLOADABLE float clamp(float v, float l, float u);

OVERLOADABLE float degrees(float radians);
OVERLOADABLE float radians(float degrees);
OVERLOADABLE float smoothstep(float e0, float e1, float x);

OVERLOADABLE float sign(float x);

// Half half version.
OVERLOADABLE half step(half edge, half x);
OVERLOADABLE half max(half a, half b);
OVERLOADABLE half min(half a, half b);
OVERLOADABLE half mix(half x, half y, half a);
OVERLOADABLE half clamp(half v, half l, half u);

OVERLOADABLE half degrees(half radians);
OVERLOADABLE half radians(half degrees);
OVERLOADABLE half smoothstep(half e0, half e1, half x);

OVERLOADABLE half sign(half x);
//Begin from this part is autogenerated.
//Don't modify it manually.
//common builtin functions
//gentype clamp (gentype x, gentype minval, gentype maxval)

OVERLOADABLE float2 clamp (float2 param0, float2 param1, float2 param2);
OVERLOADABLE float3 clamp (float3 param0, float3 param1, float3 param2);
OVERLOADABLE float4 clamp (float4 param0, float4 param1, float4 param2);
OVERLOADABLE float8 clamp (float8 param0, float8 param1, float8 param2);
OVERLOADABLE float16 clamp (float16 param0, float16 param1, float16 param2);
OVERLOADABLE half2 clamp (half2 param0, half2 param1, half2 param2);
OVERLOADABLE half3 clamp (half3 param0, half3 param1, half3 param2);
OVERLOADABLE half4 clamp (half4 param0, half4 param1, half4 param2);
OVERLOADABLE half8 clamp (half8 param0, half8 param1, half8 param2);
OVERLOADABLE half16 clamp (half16 param0, half16 param1, half16 param2);

//gentypef clamp (gentypef x, float minval, float maxval)

OVERLOADABLE float2 clamp (float2 param0, float param1, float param2);
OVERLOADABLE float3 clamp (float3 param0, float param1, float param2);
OVERLOADABLE float4 clamp (float4 param0, float param1, float param2);
OVERLOADABLE float8 clamp (float8 param0, float param1, float param2);
OVERLOADABLE float16 clamp (float16 param0, float param1, float param2);

//gentypeh clamp (gentypeh x, half minval, half maxval)

OVERLOADABLE half2 clamp (half2 param0, half param1, half param2);
OVERLOADABLE half3 clamp (half3 param0, half param1, half param2);
OVERLOADABLE half4 clamp (half4 param0, half param1, half param2);
OVERLOADABLE half8 clamp (half8 param0, half param1, half param2);
OVERLOADABLE half16 clamp (half16 param0, half param1, half param2);

//gentyped clamp (gentyped x, double minval, double maxval)


//gentype degrees (gentype radians)

OVERLOADABLE float2 degrees (float2 param0);
OVERLOADABLE float3 degrees (float3 param0);
OVERLOADABLE float4 degrees (float4 param0);
OVERLOADABLE float8 degrees (float8 param0);
OVERLOADABLE float16 degrees (float16 param0);
OVERLOADABLE half2 degrees (half2 param0);
OVERLOADABLE half3 degrees (half3 param0);
OVERLOADABLE half4 degrees (half4 param0);
OVERLOADABLE half8 degrees (half8 param0);
OVERLOADABLE half16 degrees (half16 param0);

//gentype max (gentype x,  gentype y)

OVERLOADABLE float2 max (float2 param0, float2 param1);
OVERLOADABLE float3 max (float3 param0, float3 param1);
OVERLOADABLE float4 max (float4 param0, float4 param1);
OVERLOADABLE float8 max (float8 param0, float8 param1);
OVERLOADABLE float16 max (float16 param0, float16 param1);
OVERLOADABLE half2 max (half2 param0, half2 param1);
OVERLOADABLE half3 max (half3 param0, half3 param1);
OVERLOADABLE half4 max (half4 param0, half4 param1);
OVERLOADABLE half8 max (half8 param0, half8 param1);
OVERLOADABLE half16 max (half16 param0, half16 param1);

//gentypef max (gentypef x, float y)

OVERLOADABLE float2 max (float2 param0, float param1);
OVERLOADABLE float3 max (float3 param0, float param1);
OVERLOADABLE float4 max (float4 param0, float param1);
OVERLOADABLE float8 max (float8 param0, float param1);
OVERLOADABLE float16 max (float16 param0, float param1);

//gentypeh max (gentypeh x, half y)

OVERLOADABLE half2 max (half2 param0, half param1);
OVERLOADABLE half3 max (half3 param0, half param1);
OVERLOADABLE half4 max (half4 param0, half param1);
OVERLOADABLE half8 max (half8 param0, half param1);
OVERLOADABLE half16 max (half16 param0, half param1);

//gentyped max (gentyped x, double y)


//gentype min (gentype x,  gentype y)

OVERLOADABLE float2 min (float2 param0, float2 param1);
OVERLOADABLE float3 min (float3 param0, float3 param1);
OVERLOADABLE float4 min (float4 param0, float4 param1);
OVERLOADABLE float8 min (float8 param0, float8 param1);
OVERLOADABLE float16 min (float16 param0, float16 param1);
OVERLOADABLE half2 min (half2 param0, half2 param1);
OVERLOADABLE half3 min (half3 param0, half3 param1);
OVERLOADABLE half4 min (half4 param0, half4 param1);
OVERLOADABLE half8 min (half8 param0, half8 param1);
OVERLOADABLE half16 min (half16 param0, half16 param1);

//gentypef min (gentypef x,  float y)

OVERLOADABLE float2 min (float2 param0, float param1);
OVERLOADABLE float3 min (float3 param0, float param1);
OVERLOADABLE float4 min (float4 param0, float param1);
OVERLOADABLE float8 min (float8 param0, float param1);
OVERLOADABLE float16 min (float16 param0, float param1);

//gentypeh min (gentypeh x,  half y)

OVERLOADABLE half2 min (half2 param0, half param1);
OVERLOADABLE half3 min (half3 param0, half param1);
OVERLOADABLE half4 min (half4 param0, half param1);
OVERLOADABLE half8 min (half8 param0, half param1);
OVERLOADABLE half16 min (half16 param0, half param1);

//gentyped min (gentyped x,  double y)


//gentype mix (gentype x, gentype y, gentype a)

OVERLOADABLE float2 mix (float2 param0, float2 param1, float2 param2);
OVERLOADABLE float3 mix (float3 param0, float3 param1, float3 param2);
OVERLOADABLE float4 mix (float4 param0, float4 param1, float4 param2);
OVERLOADABLE float8 mix (float8 param0, float8 param1, float8 param2);
OVERLOADABLE float16 mix (float16 param0, float16 param1, float16 param2);
OVERLOADABLE half2 mix (half2 param0, half2 param1, half2 param2);
OVERLOADABLE half3 mix (half3 param0, half3 param1, half3 param2);
OVERLOADABLE half4 mix (half4 param0, half4 param1, half4 param2);
OVERLOADABLE half8 mix (half8 param0, half8 param1, half8 param2);
OVERLOADABLE half16 mix (half16 param0, half16 param1, half16 param2);

//gentypef mix (gentypef x, gentypef y, float a)

OVERLOADABLE float2 mix (float2 param0, float2 param1, float param2);
OVERLOADABLE float3 mix (float3 param0, float3 param1, float param2);
OVERLOADABLE float4 mix (float4 param0, float4 param1, float param2);
OVERLOADABLE float8 mix (float8 param0, float8 param1, float param2);
OVERLOADABLE float16 mix (float16 param0, float16 param1, float param2);

//gentypeh mix (gentypeh x, gentypeh y, half a)

OVERLOADABLE half2 mix (half2 param0, half2 param1, half param2);
OVERLOADABLE half3 mix (half3 param0, half3 param1, half param2);
OVERLOADABLE half4 mix (half4 param0, half4 param1, half param2);
OVERLOADABLE half8 mix (half8 param0, half8 param1, half param2);
OVERLOADABLE half16 mix (half16 param0, half16 param1, half param2);

//gentyped mix (gentyped x, gentyped y, double a)


//gentype radians (gentype degrees)

OVERLOADABLE float2 radians (float2 param0);
OVERLOADABLE float3 radians (float3 param0);
OVERLOADABLE float4 radians (float4 param0);
OVERLOADABLE float8 radians (float8 param0);
OVERLOADABLE float16 radians (float16 param0);
OVERLOADABLE half2 radians (half2 param0);
OVERLOADABLE half3 radians (half3 param0);
OVERLOADABLE half4 radians (half4 param0);
OVERLOADABLE half8 radians (half8 param0);
OVERLOADABLE half16 radians (half16 param0);

//gentype step (gentype edge, gentype x)

OVERLOADABLE float2 step (float2 param0, float2 param1);
OVERLOADABLE float3 step (float3 param0, float3 param1);
OVERLOADABLE float4 step (float4 param0, float4 param1);
OVERLOADABLE float8 step (float8 param0, float8 param1);
OVERLOADABLE float16 step (float16 param0, float16 param1);
OVERLOADABLE half2 step (half2 param0, half2 param1);
OVERLOADABLE half3 step (half3 param0, half3 param1);
OVERLOADABLE half4 step (half4 param0, half4 param1);
OVERLOADABLE half8 step (half8 param0, half8 param1);
OVERLOADABLE half16 step (half16 param0, half16 param1);

//gentypef step (float edge, gentypef x)

OVERLOADABLE float2 step (float param0, float2 param1);
OVERLOADABLE float3 step (float param0, float3 param1);
OVERLOADABLE float4 step (float param0, float4 param1);
OVERLOADABLE float8 step (float param0, float8 param1);
OVERLOADABLE float16 step (float param0, float16 param1);

//gentypeh step (half edge, gentypeh x)

OVERLOADABLE half2 step (half param0, half2 param1);
OVERLOADABLE half3 step (half param0, half3 param1);
OVERLOADABLE half4 step (half param0, half4 param1);
OVERLOADABLE half8 step (half param0, half8 param1);
OVERLOADABLE half16 step (half param0, half16 param1);

//gentyped step (double edge, gentyped x)


//gentype smoothstep (gentype edge0, gentype edge1, gentype x)

OVERLOADABLE float2 smoothstep (float2 param0, float2 param1, float2 param2);
OVERLOADABLE float3 smoothstep (float3 param0, float3 param1, float3 param2);
OVERLOADABLE float4 smoothstep (float4 param0, float4 param1, float4 param2);
OVERLOADABLE float8 smoothstep (float8 param0, float8 param1, float8 param2);
OVERLOADABLE float16 smoothstep (float16 param0, float16 param1, float16 param2);
OVERLOADABLE half2 smoothstep (half2 param0, half2 param1, half2 param2);
OVERLOADABLE half3 smoothstep (half3 param0, half3 param1, half3 param2);
OVERLOADABLE half4 smoothstep (half4 param0, half4 param1, half4 param2);
OVERLOADABLE half8 smoothstep (half8 param0, half8 param1, half8 param2);
OVERLOADABLE half16 smoothstep (half16 param0, half16 param1, half16 param2);

//gentypef smoothstep (float edge0, float edge1, gentypef x)

OVERLOADABLE float2 smoothstep (float param0, float param1, float2 param2);
OVERLOADABLE float3 smoothstep (float param0, float param1, float3 param2);
OVERLOADABLE float4 smoothstep (float param0, float param1, float4 param2);
OVERLOADABLE float8 smoothstep (float param0, float param1, float8 param2);
OVERLOADABLE float16 smoothstep (float param0, float param1, float16 param2);

//gentypeh smoothstep (half edge0, half edge1, gentypeh x)

OVERLOADABLE half2 smoothstep (half param0, half param1, half2 param2);
OVERLOADABLE half3 smoothstep (half param0, half param1, half3 param2);
OVERLOADABLE half4 smoothstep (half param0, half param1, half4 param2);
OVERLOADABLE half8 smoothstep (half param0, half param1, half8 param2);
OVERLOADABLE half16 smoothstep (half param0, half param1, half16 param2);

//gentyped smoothstep (double edge0, double edge1, gentyped x)


//gentype sign (gentype x)

OVERLOADABLE float2 sign (float2 param0);
OVERLOADABLE float3 sign (float3 param0);
OVERLOADABLE float4 sign (float4 param0);
OVERLOADABLE float8 sign (float8 param0);
OVERLOADABLE float16 sign (float16 param0);
OVERLOADABLE half2 sign (half2 param0);
OVERLOADABLE half3 sign (half3 param0);
OVERLOADABLE half4 sign (half4 param0);
OVERLOADABLE half8 sign (half8 param0);
OVERLOADABLE half16 sign (half16 param0);

#endif