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