From f2a69f30fb159f4dd7d6550562e6e0c2e1f05c3a Mon Sep 17 00:00:00 2001 From: "A. Unique TensorFlower" Date: Fri, 1 Jul 2016 11:52:36 -0800 Subject: Handle cudaMemcpyAsync_v3020 API callback in GpuTracer. Reduce verbosity of logging. Change: 126437651 --- tensorflow/core/common_runtime/gpu/gpu_tracer.cc | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/tensorflow/core/common_runtime/gpu/gpu_tracer.cc b/tensorflow/core/common_runtime/gpu/gpu_tracer.cc index 585285258f..82d8b7129a 100644 --- a/tensorflow/core/common_runtime/gpu/gpu_tracer.cc +++ b/tensorflow/core/common_runtime/gpu/gpu_tracer.cc @@ -479,20 +479,25 @@ void GPUTracerImpl::AddCorrelationId(uint32 correlation_id, if (cbInfo->callbackSite == CUPTI_API_ENTER) { auto *params = reinterpret_cast( cbInfo->functionParams); - VLOG(2) << "LAUNCH stream " << params->hStream << " correllation " - << cbInfo->correlationId << " kernel " << cbInfo->symbolName; + if (VLOG_IS_ON(2)) { + VLOG(2) << "LAUNCH stream " << params->hStream << " correllation " + << cbInfo->correlationId << " kernel " << cbInfo->symbolName; + } const string annotation = tls_annotation ? tls_annotation : cbInfo->symbolName; tracer->AddCorrelationId(cbInfo->correlationId, annotation); } } else if ((domain == CUPTI_CB_DOMAIN_RUNTIME_API) && - (cbid == CUPTI_RUNTIME_TRACE_CBID_cudaMemcpy_v3020)) { + (cbid == CUPTI_RUNTIME_TRACE_CBID_cudaMemcpy_v3020 || + cbid == CUPTI_RUNTIME_TRACE_CBID_cudaMemcpyAsync_v3020)) { if (cbInfo->callbackSite == CUPTI_API_ENTER) { - auto *funcParams = reinterpret_cast( - cbInfo->functionParams); - size_t count = funcParams->count; - enum cudaMemcpyKind kind = funcParams->kind; - VLOG(2) << "MEMCPY count " << count << " kind " << kind; + if (VLOG_IS_ON(2)) { + auto *funcParams = reinterpret_cast( + cbInfo->functionParams); + size_t count = funcParams->count; + enum cudaMemcpyKind kind = funcParams->kind; + VLOG(2) << "MEMCPY count " << count << " kind " << kind; + } if (tls_annotation) { const string annotation = tls_annotation; tracer->AddCorrelationId(cbInfo->correlationId, annotation); @@ -510,7 +515,7 @@ void GPUTracerImpl::AddCorrelationId(uint32 correlation_id, tracer->AddCorrelationId(cbInfo->correlationId, annotation); } } else { - LOG(WARNING) << "Unhandled API Callback for " << domain << " " << cbid; + VLOG(1) << "Unhandled API Callback for " << domain << " " << cbid; } } -- cgit v1.2.3