summaryrefslogtreecommitdiff
path: root/kernels/compiler_type_casting.cl
blob: 3cdb925a401d8d381faadd75541efc138a47492f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/* test OpenCL 1.1 Conversions & Type Casting Examples (section 6.2) */
__kernel void compiler_type_casting() {
  float f = 1.23456789f;
  float g;

  g = (float)f;
  g = convert_float(f);
  g = as_float(f);
  
  g = convert_float_rte(f);
  g = convert_float_rtz(f);
  g = convert_float_rtp(f);
  g = convert_float_rtn(f);

  g = convert_float_sat_rte(f);
  g = convert_float_sat_rtz(f);
  g = convert_float_sat_rtp(f);
  g = convert_float_sat_rtn(f);
}