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

Method WaitForDefinitionEventOnStream

tensorflow/compiler/jit/xla_tensor.cc:76–92  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

74}
75
76void XlaTensor::WaitForDefinitionEventOnStream(se::Stream* stream) {
77 mutex_lock lock(mu_);
78 if (!definition_event_) {
79 return;
80 }
81
82 // The set of defined streams is expected to be very small indeed (usually
83 // 1-2), so a simple linear scan should be fast enough.
84 if (std::find(streams_defined_on_.begin(), streams_defined_on_.end(),
85 stream) != streams_defined_on_.end()) {
86 // stream is in streams_defined_on_; it doesn't need to be waited on.
87 return;
88 }
89
90 stream->ThenWaitFor(definition_event_.get());
91 streams_defined_on_.push_back(stream);
92}
93
94void XlaTensor::ResetDefinitionEvent(std::shared_ptr<se::Event> event,
95 se::Stream* stream) {

Callers 2

CopyDeviceTensorToCPUMethod · 0.80
PopulateInputsMethod · 0.80

Calls 4

beginMethod · 0.45
endMethod · 0.45
getMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected