Generates rationals in (0, 1]
| 93 | |
| 94 | // Generates rationals in (0, 1] |
| 95 | __device__ static __half getHalf01(uint num) { |
| 96 | // convert to ushort before the min operation |
| 97 | ushort v = min(max_int_before_infinity, ushort(num)); |
| 98 | return __hfma(__ushort2half_rn(v), HALF_FACTOR, HALF_HALF_FACTOR); |
| 99 | } |
| 100 | |
| 101 | // Generates rationals in (-1, 1] |
| 102 | __device__ static __half getHalfNegative11(uint num) { |
no test coverage detected