aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/compiler/xla/service/local_service.h
diff options
context:
space:
mode:
authorGravatar Chris Leary <leary@google.com>2018-01-04 17:20:45 -0800
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-01-04 17:23:53 -0800
commitd81f7a22b5bd0a817e6af1232c007dabef1111db (patch)
treefea23a145b7a8bb8f1863ca9a15219027f964d9a /tensorflow/compiler/xla/service/local_service.h
parentfd08eb095a71ca14667bc2bba367f0f64dc90f6b (diff)
[XLA] Expose replicas via local client API.
PiperOrigin-RevId: 180868190
Diffstat (limited to 'tensorflow/compiler/xla/service/local_service.h')
-rw-r--r--tensorflow/compiler/xla/service/local_service.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/tensorflow/compiler/xla/service/local_service.h b/tensorflow/compiler/xla/service/local_service.h
index 52c4346385..acbc726825 100644
--- a/tensorflow/compiler/xla/service/local_service.h
+++ b/tensorflow/compiler/xla/service/local_service.h
@@ -47,6 +47,13 @@ class LocalService : public Service {
const tensorflow::gtl::ArraySlice<const Shape*> argument_layouts,
const Shape* result_layout, int device_ordinal);
+ // Returns the device ordinal that corresponds to the given replica number.
+ //
+ // This returns an error if there is not a one-to-one correspondence of
+ // replicas to device ordinals, but is useful as a short term mechanism for
+ // the "easy" case where a single replica is a single device.
+ StatusOr<int> ReplicaNumberToDeviceOrdinal(int replica_number);
+
private:
explicit LocalService(const ServiceOptions& options,
std::unique_ptr<Backend> backend);