xref: /llvm-project/clang/test/CodeGenCUDA/Inputs/ocml-sample.cl (revision bc37be1855773c1dcf8c6bf577a096a81fd58652)
1#pragma OPENCL EXTENSION cl_khr_fp16 : enable
2
3half do_f16_stuff(half a, half b, half c) {
4  return __builtin_fmaf16(a, b, c) + 4.0h;
5}
6
7float do_f32_stuff(float a, float b, float c) {
8  return __builtin_fmaf(a, b, c) + 4.0f;
9}
10
11double do_f64_stuff(double a, double b, double c) {
12  return __builtin_fma(a, b, c) + 4.0;
13}
14
15__attribute__((weak))
16float weak_do_f32_stuff(float a, float b, float c) {
17  return c * (a / b);
18}
19