<commit_before>#ifdef cl_khr_fp16
__attribute__((__overloadable__))
half length(half p)
{
  return sqrt(dot(p, p));
}

__attribute__((__overloadable__))
half length(half2 p)
{
  return sqrt(dot(p, p));
}

__attribute__((__overloadable__))
half length(half3 p)
{
  return sqrt(dot(p, p));
}

__attribute__((__overloadable__))
half length(half4 p)
{
  return sqrt(dot(p, p));
}
#endif

__attribute__((__overloadable__))
float length(float p)
{
  return sqrt(dot(p, p));
}

__attribute__((__overloadable__))
float length(float2 p)
{
  return sqrt(dot(p, p));
}

__attribute__((__overloadable__))
float length(float3 p)
{
  return sqrt(dot(p, p));
}

__attribute__((__overloadable__))
float length(float4 p)
{
  return sqrt(dot(p, p));
}

#ifdef cl_khr_fp64
__attribute__((__overloadable__))
double length(double p)
{
  return sqrt(dot(p, p));
}

__attribute__((__overloadable__))
double length(double2 p)
{
  return sqrt(dot(p, p));
}

__attribute__((__overloadable__))
double length(double3 p)
{
  return sqrt(dot(p, p));
}

__attribute__((__overloadable__))
double length(double4 p)
{
  return sqrt(dot(p, p));
}
#endif<commit_msg>Correct implementation of "length"<commit_after>#ifdef cl_khr_fp16
__attribute__((__overloadable__))
half length(half p)
{
  return fabs(p);
}

__attribute__((__overloadable__))
half length(half2 p)
{
  p = fabs(p);
  half maxp = max(p.s0, p.s1);
  if (maxp == (half)0.0f) return (half)0.0f;
  p /= maxp;
  return sqrt(dot(p, p)) * maxp;
}

__attribute__((__overloadable__))
half length(half3 p)
{
  p = fabs(p);
  half maxp = max(max(p.s0, p.s1), p.s2);
  if (maxp == (half)0.0f) return (half)0.0f;
  p /= maxp;
  return sqrt(dot(p, p)) * maxp;
}

__attribute__((__overloadable__))
half length(half4 p)
{
  p = fabs(p);
  half maxp = max(max(p.s0, p.s1), max(p.s2, p.s3));
  if (maxp == (half)0.0f) return (half)0.0f;
  p /= maxp;
  return sqrt(dot(p, p)) * maxp;
}
#endif

__attribute__((__overloadable__))
float length(float p)
{
  return fabs(p);
}

__attribute__((__overloadable__))
float length(float2 p)
{
  p = fabs(p);
  float maxp = max(p.s0, p.s1);
  if (maxp == 0.0f) return 0.0f;
  p /= maxp;
  return sqrt(dot(p, p)) * maxp;
}

__attribute__((__overloadable__))
float length(float3 p)
{
  p = fabs(p);
  float maxp = max(max(p.s0, p.s1), p.s2);
  if (maxp == 0.0f) return 0.0f;
  p /= maxp;
  return sqrt(dot(p, p)) * maxp;
}

__attribute__((__overloadable__))
float length(float4 p)
{
  p = fabs(p);
  float maxp = max(max(p.s0, p.s1), max(p.s2, p.s3));
  if (maxp == 0.0f) return 0.0f;
  p /= maxp;
  return sqrt(dot(p, p)) * maxp;
}

#ifdef cl_khr_fp64
__attribute__((__overloadable__))
double length(double p)
{
  return fabs(p);
}

__attribute__((__overloadable__))
double length(double2 p)
{
  p = fabs(p);
  double maxp = max(p.s0, p.s1);
  if (maxp == 0.0) return 0.0;
  p /= maxp;
  return sqrt(dot(p, p)) * maxp;
}

__attribute__((__overloadable__))
double length(double3 p)
{
  p = fabs(p);
  double maxp = max(max(p.s0, p.s1), p.s2);
  if (maxp == 0.0) return 0.0;
  p /= maxp;
  return sqrt(dot(p, p)) * maxp;
}

__attribute__((__overloadable__))
double length(double4 p)
{
  p = fabs(p);
  double maxp = max(max(p.s0, p.s1), max(p.s2, p.s3));
  if (maxp == 0.0) return 0.0;
  p /= maxp;
  return sqrt(dot(p, p)) * maxp;
}
#endif
{'fraction_non_alphanumeric': 0.1792452830188679, 'fraction_numerical': 0.027084601339013997, 'mean_word_length': 4.451077943615257, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '507444', 'n_tokens_mistral': 1521, 'n_tokens_neox': 1482, 'n_words': 314}