| 497 | } |
| 498 | |
| 499 | rng::RngSupport *StreamExecutor::AsRng() { |
| 500 | absl::MutexLock lock(&mu_); |
| 501 | if (rng_ != nullptr) { |
| 502 | return rng_.get(); |
| 503 | } |
| 504 | |
| 505 | rng_.reset(implementation_->CreateRng()); |
| 506 | return rng_.get(); |
| 507 | } |
| 508 | |
| 509 | port::Status StreamExecutor::Launch(Stream *stream, |
| 510 | const ThreadDim &thread_dims, |