diff options
Diffstat (limited to 'tensorflow/core/common_runtime')
4 files changed, 13 insertions, 7 deletions
diff --git a/tensorflow/core/common_runtime/gpu/process_state.cc b/tensorflow/core/common_runtime/gpu/process_state.cc index 0e21e37fd3..7a1c10d900 100644 --- a/tensorflow/core/common_runtime/gpu/process_state.cc +++ b/tensorflow/core/common_runtime/gpu/process_state.cc @@ -127,7 +127,7 @@ Allocator* ProcessState::GetGPUAllocator(const GPUOptions& options, int gpu_id, gpu_platform->ExecutorForDevice(gpu_id).ValueOrDie(); int bus_id = se->GetDeviceDescription().numa_node(); if (bus_id >= 0 && bus_id < static_cast<int64>(gpu_visitors_.size())) { - for (auto v : gpu_visitors_[bus_id]) { + for (const auto& v : gpu_visitors_[bus_id]) { gpu_allocators_[gpu_id]->AddAllocVisitor(v); } } diff --git a/tensorflow/core/common_runtime/kernel_benchmark_testlib.cc b/tensorflow/core/common_runtime/kernel_benchmark_testlib.cc index 7b5cc1c5cb..4a5b88d5fd 100644 --- a/tensorflow/core/common_runtime/kernel_benchmark_testlib.cc +++ b/tensorflow/core/common_runtime/kernel_benchmark_testlib.cc @@ -39,7 +39,8 @@ namespace tensorflow { namespace test { Benchmark::Benchmark(const string& device, Graph* g, - const SessionOptions* options, Graph* init) { + const SessionOptions* options, Graph* init, + Rendezvous* rendez) { SessionOptions default_options; if (!options) { options = &default_options; @@ -61,7 +62,11 @@ Benchmark::Benchmark(const string& device, Graph* g, pool_->Schedule(closure); }; - rendez_ = NewLocalRendezvous(); + if (rendez == nullptr) { + rendez_ = NewLocalRendezvous(); + } else { + rendez_ = rendez; + } const int graph_def_version = g->versions().producer(); diff --git a/tensorflow/core/common_runtime/kernel_benchmark_testlib.h b/tensorflow/core/common_runtime/kernel_benchmark_testlib.h index 278a6b3f9f..3a7b3a5ace 100644 --- a/tensorflow/core/common_runtime/kernel_benchmark_testlib.h +++ b/tensorflow/core/common_runtime/kernel_benchmark_testlib.h @@ -35,10 +35,11 @@ namespace test { class Benchmark { public: - // "device" must be either "cpu" or "gpu". Takes ownership of "g" - // and "init". + // "device" must be either "cpu" or "gpu". Takes ownership of "g", + // "init", and one reference on "rendez" (if not null). Benchmark(const string& device, Graph* g, - const SessionOptions* options = nullptr, Graph* init = nullptr); + const SessionOptions* options = nullptr, Graph* init = nullptr, + Rendezvous* rendez = nullptr); ~Benchmark(); // Executes the graph for "iters" times. diff --git a/tensorflow/core/common_runtime/shape_refiner_test.cc b/tensorflow/core/common_runtime/shape_refiner_test.cc index 466b779e9b..b705bd74c2 100644 --- a/tensorflow/core/common_runtime/shape_refiner_test.cc +++ b/tensorflow/core/common_runtime/shape_refiner_test.cc @@ -557,7 +557,7 @@ TEST(ShapeRefinerTest, ConstantValueAsShape_PackInt32) { .Finalize(root.graph(), &result)); ShapeRefiner m(TF_GRAPH_DEF_VERSION, OpRegistry::Global()); - for (auto input : inputs) { + for (const auto& input : inputs) { TF_ASSERT_OK(m.AddNode(input.node())); } TF_ASSERT_OK(m.AddNode(pack.node())); |