| 103 | if (needsFp64) kernel << "#pragma OPENCL EXTENSION cl_khr_fp64 : enable\n"; |
| 104 | if (needsFp16) kernel << "#pragma OPENCL EXTENSION cl_khr_fp16 : enable\n"; |
| 105 | } |
| 106 | |
| 107 | std::string GetBuildOptions(const BuildKernelInfo &info) |
| 108 | { |
| 109 | std::ostringstream options; |
| 110 | |
| 111 | if (gForceFTZ) |
| 112 | { |
| 113 | options << " -cl-denorms-are-zero"; |
| 114 | } |
| 115 | |
| 116 | if (info.relaxedMode) |
| 117 | { |
| 118 | options << " -cl-fast-relaxed-math"; |
| 119 | } |
| 120 | |
| 121 | if (info.correctlyRounded) |
| 122 | { |
| 123 | options << " -cl-fp32-correctly-rounded-divide-sqrt"; |
| 124 | } |
| 125 | |
| 126 | return options.str(); |
| 127 | } |
| 128 | |