MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / GetStream

Method GetStream

tensorflow/compiler/xla/service/gpu/infeed_manager.cc:23–38  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

21namespace gpu {
22
23se::Stream* InfeedManager::GetStream(se::StreamExecutor* executor) {
24 tensorflow::mutex_lock l(host_to_device_stream_mu_);
25 if (host_to_device_executor_ == nullptr) {
26 host_to_device_executor_ = executor;
27 host_to_device_stream_ = absl::make_unique<se::Stream>(executor);
28 host_to_device_stream_->Init();
29 }
30
31 if (executor != host_to_device_executor_) {
32 // The requested executor must be the same as the one for which
33 // the stream is cached.
34 return nullptr;
35 }
36
37 return host_to_device_stream_.get();
38}
39
40InfeedManager* GetOrCreateInfeedManager() {
41 static InfeedManager* manager = new InfeedManager;

Callers 5

XlaCompilerMethod · 0.45
CompileMethod · 0.45
ComputeMethod · 0.45

Calls 2

InitMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected