aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/compiler/xla/service/compiler.h
diff options
context:
space:
mode:
authorGravatar Mark Heffernan <meheff@google.com>2017-02-10 15:28:12 -0800
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2017-02-10 15:49:40 -0800
commit56eb0007c04fe47f61323a3014c9a7fb176b0d70 (patch)
tree49e735249dab837db24d01f5c604ce4a8bf19874 /tensorflow/compiler/xla/service/compiler.h
parent674fdc3d90031da055767a2fda5ac8bfd2b2feb5 (diff)
Add bytes accessed to HLO profile output. Bytes accessed is a measure of the bytes read/written from memory during execution of an HLO op. It is typically the sum of the sizes of the operands and output. Sample line from profile table:
337 cycles ( 47.87%) :: 0.5 usec @ f_nom :: 263.80MFLOP/s :: 12.0KiB :: %multiply = ... The 12.0KiB is the change. As part of this change unconditionally gather bytes accessed information with HloCostAnalysis. This requires that the shape size computation be universally accessible so ShapeSizeBytes method was added to xla::Compiler which enabled some cleanup in various places. Change: 147206509
Diffstat (limited to 'tensorflow/compiler/xla/service/compiler.h')
-rw-r--r--tensorflow/compiler/xla/service/compiler.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/tensorflow/compiler/xla/service/compiler.h b/tensorflow/compiler/xla/service/compiler.h
index 85c2d03e1b..45cbe2b7ae 100644
--- a/tensorflow/compiler/xla/service/compiler.h
+++ b/tensorflow/compiler/xla/service/compiler.h
@@ -153,6 +153,9 @@ class Compiler {
static StatusOr<Compiler*> GetForPlatform(
const perftools::gputools::Platform* platform);
+ // Returns the size in bytes of the top-level buffer of a shape.
+ virtual int64 ShapeSizeBytes(const Shape& shape) const = 0;
+
private:
// Mutex that guards the platform-compiler map.
static tensorflow::mutex* platform_compiler_mutex_;