diff options
author | A. Unique TensorFlower <gardener@tensorflow.org> | 2017-01-20 11:32:36 -0800 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2017-01-20 11:45:29 -0800 |
commit | c31294351628addffc1cd89687fad0e81bac5a55 (patch) | |
tree | b46ae106452f55a0e65b132f1ee33399a6c6b0ed /tensorflow/stream_executor/stream_executor_pimpl.cc | |
parent | 45208ae00457d92ae4bb5889a35597a155074457 (diff) |
Better StreamExecutor constructor
Using std::unique for the implementation argument makes it clear that
StreamExecutor is taking ownership of that argument.
Change: 145107302
Diffstat (limited to 'tensorflow/stream_executor/stream_executor_pimpl.cc')
-rw-r--r-- | tensorflow/stream_executor/stream_executor_pimpl.cc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/tensorflow/stream_executor/stream_executor_pimpl.cc b/tensorflow/stream_executor/stream_executor_pimpl.cc index 71a5a45b67..c498eecb3c 100644 --- a/tensorflow/stream_executor/stream_executor_pimpl.cc +++ b/tensorflow/stream_executor/stream_executor_pimpl.cc @@ -164,9 +164,10 @@ StreamExecutor::StreamExecutor(PlatformKind platform_kind, } StreamExecutor::StreamExecutor( - const Platform *platform, internal::StreamExecutorInterface *implementation) + const Platform *platform, + std::unique_ptr<internal::StreamExecutorInterface> implementation) : platform_(platform), - implementation_(implementation), + implementation_(std::move(implementation)), device_ordinal_(-1), background_threads_(new port::ThreadPool( port::Env::Default(), "stream_executor", kNumBackgroundThreads)), |