aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/stream_executor/kernel.cc
diff options
context:
space:
mode:
authorGravatar A. Unique TensorFlower <gardener@tensorflow.org>2018-01-15 16:32:18 -0800
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-01-15 16:35:54 -0800
commit6cbf156e72ae73415603b06d11ed981295835f65 (patch)
tree40f871c384b665db8869289937e4d68fce03dfe1 /tensorflow/stream_executor/kernel.cc
parenta976d3c0843932e6226c7571e94f542b1b7d2dc6 (diff)
Avoid unloading kernels that haven't been loaded and fix replay_computation to
destroy the local client instance. Add a user defined move constructor for KernelBase to nullify the parent stream pointer. This is needed to avoid unloading kernels that haven't been loaded when the moved-from KernelBase objects are destructed. Add a call to ClientLibrary::DestroyLocalInstances to destroy the local client instance used by replay_computation. PiperOrigin-RevId: 181995818
Diffstat (limited to 'tensorflow/stream_executor/kernel.cc')
-rw-r--r--tensorflow/stream_executor/kernel.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/tensorflow/stream_executor/kernel.cc b/tensorflow/stream_executor/kernel.cc
index e1b3635d52..81e531efb3 100644
--- a/tensorflow/stream_executor/kernel.cc
+++ b/tensorflow/stream_executor/kernel.cc
@@ -57,6 +57,15 @@ void KernelMetadata::set_shared_memory_bytes(int shared_memory_bytes) {
has_shared_memory_bytes_ = true;
}
+KernelBase::KernelBase(KernelBase &&from)
+ : parent_(from.parent_),
+ implementation_(std::move(from.implementation_)),
+ name_(std::move(from.name_)),
+ demangled_name_(std::move(from.demangled_name_)),
+ metadata_(from.metadata_) {
+ from.parent_ = nullptr;
+}
+
KernelBase::KernelBase(StreamExecutor *parent)
: parent_(parent),
implementation_(parent->implementation()->CreateKernelImplementation()) {}