| 64 | } |
| 65 | |
| 66 | uint32 GetXLARandomSeed() { |
| 67 | // We initialize counter with an odd number and increment it by two |
| 68 | // everytime. This ensures that it will never be zero, even |
| 69 | // after an overflow. When seeded with zero, some XLA backends |
| 70 | // can return all zeros instead of random numbers. |
| 71 | static std::atomic<uint32> counter(InitialRandomSeed()); |
| 72 | return counter.fetch_add(2); |
| 73 | } |
| 74 | |
| 75 | xla::StatusOr<InputBuffers> GetInputBuffers( |
| 76 | XRTMemoryManager::WorkingSet* working_set, xla::Backend* backend, |
no test coverage detected