19 lines · plain
1#pragma OPENCL EXTENSION cl_khr_fp16 : enable2 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