| 86 | } |
| 87 | |
| 88 | float torch_cuda_uniform_element(uint64_t seed, uint64_t index) { |
| 89 | const Philox4 counter{ |
| 90 | 0U, |
| 91 | 0U, |
| 92 | static_cast<uint32_t>(index), |
| 93 | static_cast<uint32_t>(index >> 32U), |
| 94 | }; |
| 95 | const Philox4 random = philox_4x32_10(counter, seed); |
| 96 | return static_cast<float>(random.x) * kInvTwoPow32 + (kInvTwoPow32 * 0.5F); |
| 97 | } |
| 98 | |
| 99 | float torch_cuda_uniform_tensor_iterator_element( |
| 100 | uint64_t seed, |
no test coverage detected