~pocl/pocl/trunk

« back to all changes in this revision

Viewing changes to lib/kernel/vecmathlib-pocl/length.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
__attribute__((__overloadable__))
 
2
float length(float p)
 
3
{
 
4
  return sqrt(dot(p, p));
 
5
}
 
6
 
 
7
__attribute__((__overloadable__))
 
8
float length(float2 p)
 
9
{
 
10
  return sqrt(dot(p, p));
 
11
}
 
12
 
 
13
__attribute__((__overloadable__))
 
14
float length(float3 p)
 
15
{
 
16
  return sqrt(dot(p, p));
 
17
}
 
18
 
 
19
__attribute__((__overloadable__))
 
20
float length(float4 p)
 
21
{
 
22
  return sqrt(dot(p, p));
 
23
}
 
24
 
 
25
#ifdef cl_khr_fp64
 
26
__attribute__((__overloadable__))
 
27
double length(double p)
 
28
{
 
29
  return sqrt(dot(p, p));
 
30
}
 
31
 
 
32
__attribute__((__overloadable__))
 
33
double length(double2 p)
 
34
{
 
35
  return sqrt(dot(p, p));
 
36
}
 
37
 
 
38
__attribute__((__overloadable__))
 
39
double length(double3 p)
 
40
{
 
41
  return sqrt(dot(p, p));
 
42
}
 
43
 
 
44
__attribute__((__overloadable__))
 
45
double length(double4 p)
 
46
{
 
47
  return sqrt(dot(p, p));
 
48
}
 
49
#endif