}
}
+string BaseGPUDevice::ComputeOpKernelDebugString(const OpKernel& op_kernel,
+ const int& stream_id) {
+ return strings::StrCat(op_kernel.name(), " op ", op_kernel.type_string(),
+ " on GPU ", tf_gpu_id_.value(), " stream[", stream_id,
+ "]");
+}
+
void BaseGPUDevice::ComputeHelper(OpKernel* op_kernel,
OpKernelContext* context) {
GPUDeviceContext* gpu_device_context = device_contexts_[0];
const bool vlog_2 = vlog_1 && VLOG_IS_ON(2);
if (vlog_1) {
- VLOG(1) << "GpuDevice::Compute " << op_kernel->name() << " op "
- << op_kernel->type_string() << " on GPU" << tf_gpu_id_ << " stream["
- << stream_id << "]";
+ VLOG(1) << "GpuDevice::ComputeHelper "
+ << ComputeOpKernelDebugString(*op_kernel, stream_id);
}
const auto num_streams = streams_.size();
// all streams. Given that this flag is typically used for
// debugging it makes more sense to sync all GPU activity.
context->SetStatus(GPUUtil::SyncAll(this));
+ if (vlog_1) {
+ VLOG(1) << "GpuDevice::ComputeHelper finished "
+ << ComputeOpKernelDebugString(*op_kernel, stream_id);
+ }
+ } else if (vlog_1) {
+ VLOG(1) << "GpuDevice::ComputeHelper scheduled "
+ << ComputeOpKernelDebugString(*op_kernel, stream_id);
+ }
+ } else {
+ if (vlog_1) {
+ VLOG(1) << "GpuDevice::ComputeHelper failed to schedule "
+ << ComputeOpKernelDebugString(*op_kernel, stream_id);
}
}
}
void ComputeHelper(OpKernel* op_kernel, OpKernelContext* context);
+ string ComputeOpKernelDebugString(const OpKernel& op_kernel,
+ const int& stream_id);
+
// This method returns an initialization status, in addition to
// calling the "done" StatusCallback, if there is a failure to
// allocate memory or if the tensor "from" is not DMA-copyable.