From 09d58c60128694888e2d45b513466aca754a6242 Mon Sep 17 00:00:00 2001 From: Jose Baiocchi Date: Mon, 11 Nov 2019 17:47:52 -0800 Subject: [PATCH] Fix rocm build PiperOrigin-RevId: 279856250 Change-Id: I32dbb045d621cdbc31c6b3f906877c50770c3ad5 --- tensorflow/core/profiler/utils/xplane_builder.cc | 2 ++ tensorflow/core/profiler/utils/xplane_builder.h | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/tensorflow/core/profiler/utils/xplane_builder.cc b/tensorflow/core/profiler/utils/xplane_builder.cc index 409cb406159..43fde1696c2 100644 --- a/tensorflow/core/profiler/utils/xplane_builder.cc +++ b/tensorflow/core/profiler/utils/xplane_builder.cc @@ -14,6 +14,8 @@ limitations under the License. ==============================================================================*/ #include "tensorflow/core/profiler/utils/xplane_builder.h" +#include "absl/strings/numbers.h" + namespace tensorflow { namespace profiler { diff --git a/tensorflow/core/profiler/utils/xplane_builder.h b/tensorflow/core/profiler/utils/xplane_builder.h index 6da51ea7891..3069da5aa4b 100644 --- a/tensorflow/core/profiler/utils/xplane_builder.h +++ b/tensorflow/core/profiler/utils/xplane_builder.h @@ -74,7 +74,7 @@ class XEventBuilder { AddStat(metadata)->set_double_value(value); } void AddStatValue(const XStatMetadata& metadata, absl::string_view value) { - AddStat(metadata)->set_str_value(value); + AddStat(metadata)->set_str_value(string(value)); } void AddStatValue(const XStatMetadata& metadata, string&& value) { AddStat(metadata)->set_str_value(std::move(value)); @@ -104,10 +104,10 @@ class XLineBuilder { void SetId(int64 id) { line_->set_id(id); } - void SetName(absl::string_view name) { line_->set_name(name); } + void SetName(absl::string_view name) { line_->set_name(string(name)); } void SetNameIfEmpty(absl::string_view name) { - if (line_->name().empty()) line_->set_name(name); + if (line_->name().empty()) SetName(name); } void SetTimestampNs(int64 timestamp_ns) { @@ -133,7 +133,7 @@ class XPlaneBuilder { void SetId(int64 id) { plane_->set_id(id); } - void SetName(absl::string_view name) { plane_->set_name(name); } + void SetName(absl::string_view name) { plane_->set_name(string(name)); } void ReserveLines(size_t num_lines) { plane_->mutable_lines()->Reserve(num_lines);