diff options
author | 2017-05-09 09:14:16 -0700 | |
---|---|---|
committer | 2017-05-10 16:29:47 -0700 | |
commit | 1d0b8c007b8bc7f77dd63c74f02d87185071f038 (patch) | |
tree | b72df4064224d66c62bb4a126efb06fa214fa439 /tensorflow/stream_executor/stream_executor_pimpl.cc | |
parent | b9845c6d0d5dc601fb3b58206a7070aa8937af4f (diff) |
Remove unnecessary copies of value parameters.
PiperOrigin-RevId: 155511618
Diffstat (limited to 'tensorflow/stream_executor/stream_executor_pimpl.cc')
-rw-r--r-- | tensorflow/stream_executor/stream_executor_pimpl.cc | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/tensorflow/stream_executor/stream_executor_pimpl.cc b/tensorflow/stream_executor/stream_executor_pimpl.cc index 42fcd5867c..fe5da12639 100644 --- a/tensorflow/stream_executor/stream_executor_pimpl.cc +++ b/tensorflow/stream_executor/stream_executor_pimpl.cc @@ -20,6 +20,7 @@ limitations under the License. #include "tensorflow/stream_executor/stream_executor_pimpl.h" #include <atomic> +#include <utility> #include "tensorflow/stream_executor/blas.h" #include "tensorflow/stream_executor/fft.h" @@ -204,7 +205,7 @@ StreamExecutor::~StreamExecutor() { port::Status StreamExecutor::Init(int device_ordinal, DeviceOptions device_options) { device_ordinal_ = device_ordinal; - return implementation_->Init(device_ordinal, device_options); + return implementation_->Init(device_ordinal, std::move(device_options)); } port::Status StreamExecutor::Init() { @@ -619,7 +620,7 @@ bool StreamExecutor::Memset32(Stream *stream, DeviceMemoryBase *location, bool StreamExecutor::HostCallback(Stream *stream, std::function<void()> callback) { - return implementation_->HostCallback(stream, callback); + return implementation_->HostCallback(stream, std::move(callback)); } port::Status StreamExecutor::AllocateEvent(Event *event) { @@ -689,7 +690,7 @@ bool StreamExecutor::DeviceMemoryUsage(int64 *free, int64 *total) const { } void StreamExecutor::EnqueueOnBackgroundThread(std::function<void()> task) { - background_threads_->Schedule(task); + background_threads_->Schedule(std::move(task)); } void StreamExecutor::CreateAllocRecord(void *opaque, uint64 bytes) { |