aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/compiler/xla/service/human_readable_profile_builder.h
diff options
context:
space:
mode:
authorGravatar Justin Lebar <jlebar@google.com>2018-08-23 10:23:44 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-08-23 10:27:38 -0700
commit90d9d2b1946f80e0a13babd376ec1d91cbeef266 (patch)
treee77cd4704a0db69fd5c3240f7ac87791578d22c6 /tensorflow/compiler/xla/service/human_readable_profile_builder.h
parent5da5e8af4650287c9dcde8869ac1158d79c1415f (diff)
[XLA] Use absl string types and functions instead of the TF versions.
Unfortunately this has to be one big patch, because e.g. absl::StrCat doesn't accept a TF StringPiece, but as soon as we switch to absl::string_view, we have to switch away from all of the TF functions. PiperOrigin-RevId: 209957896
Diffstat (limited to 'tensorflow/compiler/xla/service/human_readable_profile_builder.h')
-rw-r--r--tensorflow/compiler/xla/service/human_readable_profile_builder.h9
1 files changed, 4 insertions, 5 deletions
diff --git a/tensorflow/compiler/xla/service/human_readable_profile_builder.h b/tensorflow/compiler/xla/service/human_readable_profile_builder.h
index 6f56c3aa82..b99624460e 100644
--- a/tensorflow/compiler/xla/service/human_readable_profile_builder.h
+++ b/tensorflow/compiler/xla/service/human_readable_profile_builder.h
@@ -18,8 +18,8 @@ limitations under the License.
#include <vector>
+#include "absl/strings/string_view.h"
#include "tensorflow/compiler/xla/types.h"
-#include "tensorflow/core/lib/core/stringpiece.h"
#include "tensorflow/core/platform/logging.h"
#include "tensorflow/core/platform/types.h"
@@ -29,7 +29,7 @@ namespace xla {
// computation, suitable for consumption by humans.
class HumanReadableProfileBuilder {
public:
- explicit HumanReadableProfileBuilder(tensorflow::StringPiece computation_name,
+ explicit HumanReadableProfileBuilder(absl::string_view computation_name,
int64 total_cycles,
double clock_rate_ghz)
: computation_name_(std::string(computation_name)),
@@ -43,9 +43,8 @@ class HumanReadableProfileBuilder {
// Adds an operation to the profile. If you don't know the number of
// floating-point ops or bytes touched by the op, or if you don't know how
// fast it would run optimally, pass -1 for that param.
- void AddOp(tensorflow::StringPiece op_name,
- tensorflow::StringPiece short_name,
- tensorflow::StringPiece category, int64 cycles, int64 flop_count,
+ void AddOp(absl::string_view op_name, absl::string_view short_name,
+ absl::string_view category, int64 cycles, int64 flop_count,
int64 transcendental_count, int64 bytes_accessed,
float optimal_seconds) {
op_infos_.push_back({std::string(op_name), std::string(short_name),