Generates rationals in (-1, 1]
| 100 | |
| 101 | // Generates rationals in (-1, 1] |
| 102 | __device__ static __half getHalfNegative11(uint num) { |
| 103 | // convert to ushort before the min operation |
| 104 | ushort v = min(max_int_before_infinity, ushort(num)); |
| 105 | return __hfma(__ushort2half_rn(v), SIGNED_HALF_FACTOR, |
| 106 | SIGNED_HALF_HALF_FACTOR); |
| 107 | } |
| 108 | |
| 109 | // Generates rationals in (0, 1] |
| 110 | __device__ static float getFloat01(uint num) { |
no test coverage detected