| 275 | } |
| 276 | |
| 277 | void fill_torch_cuda_uniform(float * output, size_t count, uint64_t seed, uint64_t start_index) { |
| 278 | if (output == nullptr && count != 0) { |
| 279 | throw std::invalid_argument("torch CUDA uniform output pointer is null"); |
| 280 | } |
| 281 | for (size_t index = 0; index < count; ++index) { |
| 282 | output[index] = torch_cuda_uniform_element(seed, start_index + static_cast<uint64_t>(index)); |
| 283 | } |
| 284 | } |
| 285 | |
| 286 | std::vector<float> generate_torch_cuda_uniform(size_t count, uint64_t seed, uint64_t start_index) { |
| 287 | std::vector<float> output(count); |