aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/compiler/xla/literal_util.h
diff options
context:
space:
mode:
authorGravatar Mark Heffernan <meheff@google.com>2018-06-14 14:51:26 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-06-14 14:54:32 -0700
commitf01d25471dbe26f0a1116009badc4af169f82b02 (patch)
treeddc3ff3aff6b69d49e505c92842e8ed20e413c76 /tensorflow/compiler/xla/literal_util.h
parent840aeb0ce9bd0f0a1c275edc9fe6d51eff5cf33f (diff)
Add support for TOKEN type to CPU/GPU backends.
TOKENs will be used for ordering side-effecting operations. They are not materialized but can be contained in tuples and flow into and out of computations. This CL adds a trivial representation for the cpu and gpu backends to support TOKENs and modifies copy insertion to avoid making copies of tokens. This also adds a Literal TOKEN which is required for the interpreter backend. PiperOrigin-RevId: 200623120
Diffstat (limited to 'tensorflow/compiler/xla/literal_util.h')
-rw-r--r--tensorflow/compiler/xla/literal_util.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/tensorflow/compiler/xla/literal_util.h b/tensorflow/compiler/xla/literal_util.h
index bcecbcccb7..37ca8ea9f1 100644
--- a/tensorflow/compiler/xla/literal_util.h
+++ b/tensorflow/compiler/xla/literal_util.h
@@ -917,6 +917,9 @@ class Literal : public LiteralBase {
return MakeTupleOwned(std::move(v));
}
+ // Create a constant token literal. Token types have no value.
+ static std::unique_ptr<Literal> CreateToken();
+
// Returns a vector containing the tuple elements of this Literal as separate
// Literals. This Literal must be tuple-shaped and can be a nested tuple. The
// elements are moved into the new Literals; no data is copied. Upon return