~pocl/pocl/trunk

« back to all changes in this revision

Viewing changes to lib/kernel/vecmathlib-pocl/step.cl

  • Committer: Erik Schnetter
  • Date: 2013-08-17 16:11:57 UTC
  • Revision ID: eschnetter@perimeterinstitute.ca-20130817161157-pco7u3hv98nbg2uk
Move pocl-specific Vecmathlib code into a separate subdirectory

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// Note: This file has been automatically generated. Do not modify.
 
2
 
 
3
// Needed for fract()
 
4
#define POCL_FRACT_MIN   0x1.fffffffffffffp-1
 
5
#define POCL_FRACT_MIN_F 0x1.fffffep-1f
 
6
 
 
7
// If double precision is not supported, then define
 
8
// single-precision (dummy) values to avoid compiler warnings
 
9
// for double precision values
 
10
#ifndef khr_fp64
 
11
#  undef M_PI
 
12
#  define M_PI M_PI_F
 
13
#  undef M_PI_2
 
14
#  define M_PI_2 M_PI_2_F
 
15
#  undef LONG_MAX
 
16
#  define LONG_MAX INT_MAX
 
17
#  undef LONG_MIN
 
18
#  define LONG_MIN INT_MIN
 
19
#  undef POCL_FRACT_MIN
 
20
#  define POCL_FRACT_MIN POCL_FRACT_MIN_F
 
21
#endif
 
22
 
 
23
// step: ['VF', 'VF'] -> VF
 
24
 
 
25
// step: VF=float
 
26
// Implement step directly
 
27
__attribute__((__overloadable__))
 
28
float _cl_step(float x0, float x1)
 
29
{
 
30
  typedef int kscalar_t;
 
31
  typedef float scalar_t;
 
32
  typedef int ivector_t;
 
33
  typedef int jvector_t;
 
34
  typedef int kvector_t;
 
35
  typedef float vector_t;
 
36
#define convert_ivector_t convert_int
 
37
#define convert_jvector_t convert_int
 
38
#define convert_kvector_t convert_int
 
39
#define convert_vector_t convert_float
 
40
  return x1<x0 ? (vector_t)(scalar_t)0.0f : (vector_t)(scalar_t)1.0f;
 
41
#undef convert_ivector_t
 
42
#undef convert_jvector_t
 
43
#undef convert_kvector_t
 
44
#undef convert_vector_t
 
45
}
 
46
 
 
47
// step: VF=float2
 
48
// Implement step directly
 
49
__attribute__((__overloadable__))
 
50
float2 _cl_step(float2 x0, float2 x1)
 
51
{
 
52
  typedef int kscalar_t;
 
53
  typedef float scalar_t;
 
54
  typedef int2 ivector_t;
 
55
  typedef int2 jvector_t;
 
56
  typedef int2 kvector_t;
 
57
  typedef float2 vector_t;
 
58
#define convert_ivector_t convert_int2
 
59
#define convert_jvector_t convert_int2
 
60
#define convert_kvector_t convert_int2
 
61
#define convert_vector_t convert_float2
 
62
  return x1<x0 ? (vector_t)(scalar_t)0.0f : (vector_t)(scalar_t)1.0f;
 
63
#undef convert_ivector_t
 
64
#undef convert_jvector_t
 
65
#undef convert_kvector_t
 
66
#undef convert_vector_t
 
67
}
 
68
 
 
69
// step: VF=float3
 
70
// Implement step directly
 
71
__attribute__((__overloadable__))
 
72
float3 _cl_step(float3 x0, float3 x1)
 
73
{
 
74
  typedef int kscalar_t;
 
75
  typedef float scalar_t;
 
76
  typedef int3 ivector_t;
 
77
  typedef int3 jvector_t;
 
78
  typedef int3 kvector_t;
 
79
  typedef float3 vector_t;
 
80
#define convert_ivector_t convert_int3
 
81
#define convert_jvector_t convert_int3
 
82
#define convert_kvector_t convert_int3
 
83
#define convert_vector_t convert_float3
 
84
  return x1<x0 ? (vector_t)(scalar_t)0.0f : (vector_t)(scalar_t)1.0f;
 
85
#undef convert_ivector_t
 
86
#undef convert_jvector_t
 
87
#undef convert_kvector_t
 
88
#undef convert_vector_t
 
89
}
 
90
 
 
91
// step: VF=float4
 
92
// Implement step directly
 
93
__attribute__((__overloadable__))
 
94
float4 _cl_step(float4 x0, float4 x1)
 
95
{
 
96
  typedef int kscalar_t;
 
97
  typedef float scalar_t;
 
98
  typedef int4 ivector_t;
 
99
  typedef int4 jvector_t;
 
100
  typedef int4 kvector_t;
 
101
  typedef float4 vector_t;
 
102
#define convert_ivector_t convert_int4
 
103
#define convert_jvector_t convert_int4
 
104
#define convert_kvector_t convert_int4
 
105
#define convert_vector_t convert_float4
 
106
  return x1<x0 ? (vector_t)(scalar_t)0.0f : (vector_t)(scalar_t)1.0f;
 
107
#undef convert_ivector_t
 
108
#undef convert_jvector_t
 
109
#undef convert_kvector_t
 
110
#undef convert_vector_t
 
111
}
 
112
 
 
113
// step: VF=float8
 
114
// Implement step directly
 
115
__attribute__((__overloadable__))
 
116
float8 _cl_step(float8 x0, float8 x1)
 
117
{
 
118
  typedef int kscalar_t;
 
119
  typedef float scalar_t;
 
120
  typedef int8 ivector_t;
 
121
  typedef int8 jvector_t;
 
122
  typedef int8 kvector_t;
 
123
  typedef float8 vector_t;
 
124
#define convert_ivector_t convert_int8
 
125
#define convert_jvector_t convert_int8
 
126
#define convert_kvector_t convert_int8
 
127
#define convert_vector_t convert_float8
 
128
  return x1<x0 ? (vector_t)(scalar_t)0.0f : (vector_t)(scalar_t)1.0f;
 
129
#undef convert_ivector_t
 
130
#undef convert_jvector_t
 
131
#undef convert_kvector_t
 
132
#undef convert_vector_t
 
133
}
 
134
 
 
135
// step: VF=float16
 
136
// Implement step directly
 
137
__attribute__((__overloadable__))
 
138
float16 _cl_step(float16 x0, float16 x1)
 
139
{
 
140
  typedef int kscalar_t;
 
141
  typedef float scalar_t;
 
142
  typedef int16 ivector_t;
 
143
  typedef int16 jvector_t;
 
144
  typedef int16 kvector_t;
 
145
  typedef float16 vector_t;
 
146
#define convert_ivector_t convert_int16
 
147
#define convert_jvector_t convert_int16
 
148
#define convert_kvector_t convert_int16
 
149
#define convert_vector_t convert_float16
 
150
  return x1<x0 ? (vector_t)(scalar_t)0.0f : (vector_t)(scalar_t)1.0f;
 
151
#undef convert_ivector_t
 
152
#undef convert_jvector_t
 
153
#undef convert_kvector_t
 
154
#undef convert_vector_t
 
155
}
 
156
 
 
157
#ifdef cl_khr_fp64
 
158
 
 
159
// step: VF=double
 
160
// Implement step directly
 
161
__attribute__((__overloadable__))
 
162
double _cl_step(double x0, double x1)
 
163
{
 
164
  typedef int kscalar_t;
 
165
  typedef double scalar_t;
 
166
  typedef long ivector_t;
 
167
  typedef int jvector_t;
 
168
  typedef int kvector_t;
 
169
  typedef double vector_t;
 
170
#define convert_ivector_t convert_long
 
171
#define convert_jvector_t convert_int
 
172
#define convert_kvector_t convert_int
 
173
#define convert_vector_t convert_double
 
174
  return x1<x0 ? (vector_t)(scalar_t)0.0f : (vector_t)(scalar_t)1.0f;
 
175
#undef convert_ivector_t
 
176
#undef convert_jvector_t
 
177
#undef convert_kvector_t
 
178
#undef convert_vector_t
 
179
}
 
180
 
 
181
// step: VF=double2
 
182
// Implement step directly
 
183
__attribute__((__overloadable__))
 
184
double2 _cl_step(double2 x0, double2 x1)
 
185
{
 
186
  typedef long kscalar_t;
 
187
  typedef double scalar_t;
 
188
  typedef long2 ivector_t;
 
189
  typedef long2 jvector_t;
 
190
  typedef int2 kvector_t;
 
191
  typedef double2 vector_t;
 
192
#define convert_ivector_t convert_long2
 
193
#define convert_jvector_t convert_long2
 
194
#define convert_kvector_t convert_int2
 
195
#define convert_vector_t convert_double2
 
196
  return x1<x0 ? (vector_t)(scalar_t)0.0f : (vector_t)(scalar_t)1.0f;
 
197
#undef convert_ivector_t
 
198
#undef convert_jvector_t
 
199
#undef convert_kvector_t
 
200
#undef convert_vector_t
 
201
}
 
202
 
 
203
// step: VF=double3
 
204
// Implement step directly
 
205
__attribute__((__overloadable__))
 
206
double3 _cl_step(double3 x0, double3 x1)
 
207
{
 
208
  typedef long kscalar_t;
 
209
  typedef double scalar_t;
 
210
  typedef long3 ivector_t;
 
211
  typedef long3 jvector_t;
 
212
  typedef int3 kvector_t;
 
213
  typedef double3 vector_t;
 
214
#define convert_ivector_t convert_long3
 
215
#define convert_jvector_t convert_long3
 
216
#define convert_kvector_t convert_int3
 
217
#define convert_vector_t convert_double3
 
218
  return x1<x0 ? (vector_t)(scalar_t)0.0f : (vector_t)(scalar_t)1.0f;
 
219
#undef convert_ivector_t
 
220
#undef convert_jvector_t
 
221
#undef convert_kvector_t
 
222
#undef convert_vector_t
 
223
}
 
224
 
 
225
// step: VF=double4
 
226
// Implement step directly
 
227
__attribute__((__overloadable__))
 
228
double4 _cl_step(double4 x0, double4 x1)
 
229
{
 
230
  typedef long kscalar_t;
 
231
  typedef double scalar_t;
 
232
  typedef long4 ivector_t;
 
233
  typedef long4 jvector_t;
 
234
  typedef int4 kvector_t;
 
235
  typedef double4 vector_t;
 
236
#define convert_ivector_t convert_long4
 
237
#define convert_jvector_t convert_long4
 
238
#define convert_kvector_t convert_int4
 
239
#define convert_vector_t convert_double4
 
240
  return x1<x0 ? (vector_t)(scalar_t)0.0f : (vector_t)(scalar_t)1.0f;
 
241
#undef convert_ivector_t
 
242
#undef convert_jvector_t
 
243
#undef convert_kvector_t
 
244
#undef convert_vector_t
 
245
}
 
246
 
 
247
// step: VF=double8
 
248
// Implement step directly
 
249
__attribute__((__overloadable__))
 
250
double8 _cl_step(double8 x0, double8 x1)
 
251
{
 
252
  typedef long kscalar_t;
 
253
  typedef double scalar_t;
 
254
  typedef long8 ivector_t;
 
255
  typedef long8 jvector_t;
 
256
  typedef int8 kvector_t;
 
257
  typedef double8 vector_t;
 
258
#define convert_ivector_t convert_long8
 
259
#define convert_jvector_t convert_long8
 
260
#define convert_kvector_t convert_int8
 
261
#define convert_vector_t convert_double8
 
262
  return x1<x0 ? (vector_t)(scalar_t)0.0f : (vector_t)(scalar_t)1.0f;
 
263
#undef convert_ivector_t
 
264
#undef convert_jvector_t
 
265
#undef convert_kvector_t
 
266
#undef convert_vector_t
 
267
}
 
268
 
 
269
// step: VF=double16
 
270
// Implement step directly
 
271
__attribute__((__overloadable__))
 
272
double16 _cl_step(double16 x0, double16 x1)
 
273
{
 
274
  typedef long kscalar_t;
 
275
  typedef double scalar_t;
 
276
  typedef long16 ivector_t;
 
277
  typedef long16 jvector_t;
 
278
  typedef int16 kvector_t;
 
279
  typedef double16 vector_t;
 
280
#define convert_ivector_t convert_long16
 
281
#define convert_jvector_t convert_long16
 
282
#define convert_kvector_t convert_int16
 
283
#define convert_vector_t convert_double16
 
284
  return x1<x0 ? (vector_t)(scalar_t)0.0f : (vector_t)(scalar_t)1.0f;
 
285
#undef convert_ivector_t
 
286
#undef convert_jvector_t
 
287
#undef convert_kvector_t
 
288
#undef convert_vector_t
 
289
}
 
290
 
 
291
#endif // #ifdef cl_khr_fp64
 
292
 
 
293
 
 
294
 
 
295
// step: ['SF', 'VF'] -> VF
 
296
 
 
297
// step: VF=float2
 
298
// Implement step directly
 
299
__attribute__((__overloadable__))
 
300
float2 _cl_step(float x0, float2 x1)
 
301
{
 
302
  typedef int kscalar_t;
 
303
  typedef float scalar_t;
 
304
  typedef int2 ivector_t;
 
305
  typedef int2 jvector_t;
 
306
  typedef int2 kvector_t;
 
307
  typedef float2 vector_t;
 
308
#define convert_ivector_t convert_int2
 
309
#define convert_jvector_t convert_int2
 
310
#define convert_kvector_t convert_int2
 
311
#define convert_vector_t convert_float2
 
312
  return x1<x0 ? (vector_t)(scalar_t)0.0f : (vector_t)(scalar_t)1.0f;
 
313
#undef convert_ivector_t
 
314
#undef convert_jvector_t
 
315
#undef convert_kvector_t
 
316
#undef convert_vector_t
 
317
}
 
318
 
 
319
// step: VF=float3
 
320
// Implement step directly
 
321
__attribute__((__overloadable__))
 
322
float3 _cl_step(float x0, float3 x1)
 
323
{
 
324
  typedef int kscalar_t;
 
325
  typedef float scalar_t;
 
326
  typedef int3 ivector_t;
 
327
  typedef int3 jvector_t;
 
328
  typedef int3 kvector_t;
 
329
  typedef float3 vector_t;
 
330
#define convert_ivector_t convert_int3
 
331
#define convert_jvector_t convert_int3
 
332
#define convert_kvector_t convert_int3
 
333
#define convert_vector_t convert_float3
 
334
  return x1<x0 ? (vector_t)(scalar_t)0.0f : (vector_t)(scalar_t)1.0f;
 
335
#undef convert_ivector_t
 
336
#undef convert_jvector_t
 
337
#undef convert_kvector_t
 
338
#undef convert_vector_t
 
339
}
 
340
 
 
341
// step: VF=float4
 
342
// Implement step directly
 
343
__attribute__((__overloadable__))
 
344
float4 _cl_step(float x0, float4 x1)
 
345
{
 
346
  typedef int kscalar_t;
 
347
  typedef float scalar_t;
 
348
  typedef int4 ivector_t;
 
349
  typedef int4 jvector_t;
 
350
  typedef int4 kvector_t;
 
351
  typedef float4 vector_t;
 
352
#define convert_ivector_t convert_int4
 
353
#define convert_jvector_t convert_int4
 
354
#define convert_kvector_t convert_int4
 
355
#define convert_vector_t convert_float4
 
356
  return x1<x0 ? (vector_t)(scalar_t)0.0f : (vector_t)(scalar_t)1.0f;
 
357
#undef convert_ivector_t
 
358
#undef convert_jvector_t
 
359
#undef convert_kvector_t
 
360
#undef convert_vector_t
 
361
}
 
362
 
 
363
// step: VF=float8
 
364
// Implement step directly
 
365
__attribute__((__overloadable__))
 
366
float8 _cl_step(float x0, float8 x1)
 
367
{
 
368
  typedef int kscalar_t;
 
369
  typedef float scalar_t;
 
370
  typedef int8 ivector_t;
 
371
  typedef int8 jvector_t;
 
372
  typedef int8 kvector_t;
 
373
  typedef float8 vector_t;
 
374
#define convert_ivector_t convert_int8
 
375
#define convert_jvector_t convert_int8
 
376
#define convert_kvector_t convert_int8
 
377
#define convert_vector_t convert_float8
 
378
  return x1<x0 ? (vector_t)(scalar_t)0.0f : (vector_t)(scalar_t)1.0f;
 
379
#undef convert_ivector_t
 
380
#undef convert_jvector_t
 
381
#undef convert_kvector_t
 
382
#undef convert_vector_t
 
383
}
 
384
 
 
385
// step: VF=float16
 
386
// Implement step directly
 
387
__attribute__((__overloadable__))
 
388
float16 _cl_step(float x0, float16 x1)
 
389
{
 
390
  typedef int kscalar_t;
 
391
  typedef float scalar_t;
 
392
  typedef int16 ivector_t;
 
393
  typedef int16 jvector_t;
 
394
  typedef int16 kvector_t;
 
395
  typedef float16 vector_t;
 
396
#define convert_ivector_t convert_int16
 
397
#define convert_jvector_t convert_int16
 
398
#define convert_kvector_t convert_int16
 
399
#define convert_vector_t convert_float16
 
400
  return x1<x0 ? (vector_t)(scalar_t)0.0f : (vector_t)(scalar_t)1.0f;
 
401
#undef convert_ivector_t
 
402
#undef convert_jvector_t
 
403
#undef convert_kvector_t
 
404
#undef convert_vector_t
 
405
}
 
406
 
 
407
#ifdef cl_khr_fp64
 
408
 
 
409
// step: VF=double2
 
410
// Implement step directly
 
411
__attribute__((__overloadable__))
 
412
double2 _cl_step(double x0, double2 x1)
 
413
{
 
414
  typedef long kscalar_t;
 
415
  typedef double scalar_t;
 
416
  typedef long2 ivector_t;
 
417
  typedef long2 jvector_t;
 
418
  typedef int2 kvector_t;
 
419
  typedef double2 vector_t;
 
420
#define convert_ivector_t convert_long2
 
421
#define convert_jvector_t convert_long2
 
422
#define convert_kvector_t convert_int2
 
423
#define convert_vector_t convert_double2
 
424
  return x1<x0 ? (vector_t)(scalar_t)0.0f : (vector_t)(scalar_t)1.0f;
 
425
#undef convert_ivector_t
 
426
#undef convert_jvector_t
 
427
#undef convert_kvector_t
 
428
#undef convert_vector_t
 
429
}
 
430
 
 
431
// step: VF=double3
 
432
// Implement step directly
 
433
__attribute__((__overloadable__))
 
434
double3 _cl_step(double x0, double3 x1)
 
435
{
 
436
  typedef long kscalar_t;
 
437
  typedef double scalar_t;
 
438
  typedef long3 ivector_t;
 
439
  typedef long3 jvector_t;
 
440
  typedef int3 kvector_t;
 
441
  typedef double3 vector_t;
 
442
#define convert_ivector_t convert_long3
 
443
#define convert_jvector_t convert_long3
 
444
#define convert_kvector_t convert_int3
 
445
#define convert_vector_t convert_double3
 
446
  return x1<x0 ? (vector_t)(scalar_t)0.0f : (vector_t)(scalar_t)1.0f;
 
447
#undef convert_ivector_t
 
448
#undef convert_jvector_t
 
449
#undef convert_kvector_t
 
450
#undef convert_vector_t
 
451
}
 
452
 
 
453
// step: VF=double4
 
454
// Implement step directly
 
455
__attribute__((__overloadable__))
 
456
double4 _cl_step(double x0, double4 x1)
 
457
{
 
458
  typedef long kscalar_t;
 
459
  typedef double scalar_t;
 
460
  typedef long4 ivector_t;
 
461
  typedef long4 jvector_t;
 
462
  typedef int4 kvector_t;
 
463
  typedef double4 vector_t;
 
464
#define convert_ivector_t convert_long4
 
465
#define convert_jvector_t convert_long4
 
466
#define convert_kvector_t convert_int4
 
467
#define convert_vector_t convert_double4
 
468
  return x1<x0 ? (vector_t)(scalar_t)0.0f : (vector_t)(scalar_t)1.0f;
 
469
#undef convert_ivector_t
 
470
#undef convert_jvector_t
 
471
#undef convert_kvector_t
 
472
#undef convert_vector_t
 
473
}
 
474
 
 
475
// step: VF=double8
 
476
// Implement step directly
 
477
__attribute__((__overloadable__))
 
478
double8 _cl_step(double x0, double8 x1)
 
479
{
 
480
  typedef long kscalar_t;
 
481
  typedef double scalar_t;
 
482
  typedef long8 ivector_t;
 
483
  typedef long8 jvector_t;
 
484
  typedef int8 kvector_t;
 
485
  typedef double8 vector_t;
 
486
#define convert_ivector_t convert_long8
 
487
#define convert_jvector_t convert_long8
 
488
#define convert_kvector_t convert_int8
 
489
#define convert_vector_t convert_double8
 
490
  return x1<x0 ? (vector_t)(scalar_t)0.0f : (vector_t)(scalar_t)1.0f;
 
491
#undef convert_ivector_t
 
492
#undef convert_jvector_t
 
493
#undef convert_kvector_t
 
494
#undef convert_vector_t
 
495
}
 
496
 
 
497
// step: VF=double16
 
498
// Implement step directly
 
499
__attribute__((__overloadable__))
 
500
double16 _cl_step(double x0, double16 x1)
 
501
{
 
502
  typedef long kscalar_t;
 
503
  typedef double scalar_t;
 
504
  typedef long16 ivector_t;
 
505
  typedef long16 jvector_t;
 
506
  typedef int16 kvector_t;
 
507
  typedef double16 vector_t;
 
508
#define convert_ivector_t convert_long16
 
509
#define convert_jvector_t convert_long16
 
510
#define convert_kvector_t convert_int16
 
511
#define convert_vector_t convert_double16
 
512
  return x1<x0 ? (vector_t)(scalar_t)0.0f : (vector_t)(scalar_t)1.0f;
 
513
#undef convert_ivector_t
 
514
#undef convert_jvector_t
 
515
#undef convert_kvector_t
 
516
#undef convert_vector_t
 
517
}
 
518
 
 
519
#endif // #ifdef cl_khr_fp64