diff --git a/tensorflow/stream_executor/BUILD b/tensorflow/stream_executor/BUILD index 7cf7e75a550..fca28e016af 100644 --- a/tensorflow/stream_executor/BUILD +++ b/tensorflow/stream_executor/BUILD @@ -206,7 +206,6 @@ cc_library( cc_library( name = "stream", srcs = [ - "host_buffer.h", "stream.cc", ], hdrs = ["stream.h"], @@ -453,12 +452,6 @@ cc_library( ], ) -cc_library( - name = "host_buffer", - hdrs = ["host_buffer.h"], - deps = [":dnn"], -) - tf_proto_library( name = "dnn_proto", srcs = ["dnn.proto"], diff --git a/tensorflow/stream_executor/dnn.h b/tensorflow/stream_executor/dnn.h index f5eef29109d..f60d1ada241 100644 --- a/tensorflow/stream_executor/dnn.h +++ b/tensorflow/stream_executor/dnn.h @@ -2069,22 +2069,6 @@ class DnnSupport { QuantizedActivationMode mode, DeviceMemory* gpu_unquantized_dst) = 0; - // Enqueues an asynchronous copy of the contents of buffer_src to - // gpu_unquantized_dst. - virtual bool DoCopyHostBuffer2Device( - Stream* stream, HostBuffer* buffer_src, - DeviceMemory* gpu_unquantized_dst) { - return false; - } - - // Enqueues an asynchronous copy of the contents of gpu_unquantized_src to - // buffer_dst. - virtual bool DoCopyDevice2HostBuffer( - Stream* stream, const DeviceMemory& gpu_unquantized_src, - HostBuffer* buffer_dst) { - return false; - } - // Create an RNN descriptor based on model shapes and configurations. // The caller retains the ownership of the descriptor. // diff --git a/tensorflow/stream_executor/host_buffer.h b/tensorflow/stream_executor/host_buffer.h deleted file mode 100644 index 20299da5172..00000000000 --- a/tensorflow/stream_executor/host_buffer.h +++ /dev/null @@ -1,46 +0,0 @@ -/* Copyright 2017 The TensorFlow Authors. All Rights Reserved. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -==============================================================================*/ - -#ifndef TENSORFLOW_STREAM_EXECUTOR_HOST_BUFFER_H_ -#define TENSORFLOW_STREAM_EXECUTOR_HOST_BUFFER_H_ - -#include "tensorflow/stream_executor/dnn.h" - -namespace stream_executor { - -// A HostBuffer is a block of memory in host memory containing the data for a -// dnn::BatchDescriptor using a device-dependent memory layout. -// Derived classes provide methods to construct a HostBuffer for a specific -// device, and to copy data in and out of the buffer. -class HostBuffer { - public: - const dnn::BatchDescriptor& descriptor() const { return descriptor_; } - - // Returns a string describing the HostBuffer. - virtual string AsString() const = 0; - - protected: - // Construct a HostBuffer from the supplied dnn::BatchDescriptor. - explicit HostBuffer(const dnn::BatchDescriptor& descriptor) - : descriptor_(descriptor) {} - virtual ~HostBuffer() {} - - private: - const dnn::BatchDescriptor descriptor_; -}; - -} // namespace stream_executor - -#endif // TENSORFLOW_STREAM_EXECUTOR_HOST_BUFFER_H_ diff --git a/tensorflow/stream_executor/stream.cc b/tensorflow/stream_executor/stream.cc index 0dceacb228c..e7485ca426b 100644 --- a/tensorflow/stream_executor/stream.cc +++ b/tensorflow/stream_executor/stream.cc @@ -20,7 +20,6 @@ limitations under the License. #include "absl/strings/str_cat.h" #include "third_party/eigen3/Eigen/Core" #include "tensorflow/stream_executor/blas.h" -#include "tensorflow/stream_executor/host_buffer.h" #include "tensorflow/stream_executor/host_or_device_scalar.h" #include "tensorflow/stream_executor/lib/stacktrace.h" #include "tensorflow/stream_executor/platform.h" @@ -95,8 +94,6 @@ string ToVlogString(const void *ptr) { return out.str(); } -string ToVlogString(const HostBuffer &buffer) { return buffer.AsString(); } - template string ToVlogString(const std::complex &c) { // StrCat does not convert std::complex to text. @@ -2103,36 +2100,6 @@ Stream &Stream::ThenMemcpyH2DQuantized( return *this; } -Stream &Stream::ThenCopyHostBuffer2Device( - HostBuffer *buffer_src, DeviceMemory *gpu_unquantized_dst) { - VLOG_CALL(PARAM(*buffer_src), PARAM(gpu_unquantized_dst)); - - if (ok()) { - if (dnn::DnnSupport *dnn = parent_->AsDnn()) { - CheckError( - dnn->DoCopyHostBuffer2Device(this, buffer_src, gpu_unquantized_dst)); - } else { - SetErrorAndLogNoDnnSupport(); - } - } - return *this; -} - -Stream &Stream::ThenCopyDevice2HostBuffer( - const DeviceMemory &gpu_unquantized_src, HostBuffer *buffer_dst) { - VLOG_CALL(PARAM(gpu_unquantized_src), PARAM(*buffer_dst)); - - if (ok()) { - if (dnn::DnnSupport *dnn = parent_->AsDnn()) { - CheckError( - dnn->DoCopyDevice2HostBuffer(this, gpu_unquantized_src, buffer_dst)); - } else { - SetErrorAndLogNoDnnSupport(); - } - } - return *this; -} - Stream *Stream::GetOrCreateSubStream() { mutex_lock lock(mu_);