From a42b3fc598cd028308ee9ae9dc9ed3034a04a0bf Mon Sep 17 00:00:00 2001 From: Suharsh Sivakumar Date: Tue, 4 Apr 2017 14:36:38 -0800 Subject: [PATCH] Remove warning that only happening with config cuda. Change: 152189205 --- tensorflow/core/common_runtime/gpu/gpu_device.cc | 8 ++++---- tensorflow/core/common_runtime/gpu/gpu_event_mgr_test.cc | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tensorflow/core/common_runtime/gpu/gpu_device.cc b/tensorflow/core/common_runtime/gpu/gpu_device.cc index a863b69cef0..8b9f4684875 100644 --- a/tensorflow/core/common_runtime/gpu/gpu_device.cc +++ b/tensorflow/core/common_runtime/gpu/gpu_device.cc @@ -274,14 +274,14 @@ Status BaseGPUDevice::FillContextMap(const Graph* graph, DeviceContextMap* device_context_map) { VLOG(2) << "FillContextMap"; - const auto num_streams = streams_.size(); + const size_t num_streams = streams_.size(); // Special case for single stream. if (num_streams == 1) { return Status::OK(); } const int64 before = Env::Default()->NowMicros(); gpu_stream_util::AssignStreamsOpts opts; - opts.max_streams = num_streams; + opts.max_streams = static_cast(num_streams); std::unordered_map node_to_stream_id; TF_RETURN_IF_ERROR( gpu_stream_util::AssignStreams(graph, opts, &node_to_stream_id)); @@ -519,7 +519,7 @@ void BaseGPUDevice::ReinitializeGpuDevice(OpKernelContext* context, Status BaseGPUDeviceFactory::CreateDevices(const SessionOptions& options, const string& name_prefix, std::vector* devices) { - int n = INT_MAX; + size_t n = INT_MAX; auto iter = options.config.device_count().find("GPU"); if (iter != options.config.device_count().end()) { n = iter->second; @@ -971,7 +971,7 @@ Status BaseGPUDeviceFactory::GetValidDeviceIds( continue; } - int new_id = ids->size(); + size_t new_id = ids->size(); ids->push_back(visible_gpu_id); LOG(INFO) << "Creating TensorFlow device (/gpu:" << new_id << ") -> " diff --git a/tensorflow/core/common_runtime/gpu/gpu_event_mgr_test.cc b/tensorflow/core/common_runtime/gpu/gpu_event_mgr_test.cc index e4cd79bc7f0..8226cc035c8 100644 --- a/tensorflow/core/common_runtime/gpu/gpu_event_mgr_test.cc +++ b/tensorflow/core/common_runtime/gpu/gpu_event_mgr_test.cc @@ -37,12 +37,12 @@ class TEST_EventMgrHelper { StopPollingLoop(); } - int queue_size() { + size_t queue_size() { mutex_lock l(em_->mu_); return em_->used_events_.size(); } - int free_size() { + size_t free_size() { mutex_lock l(em_->mu_); return em_->free_events_.size(); }