aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/c/c_api.h
diff options
context:
space:
mode:
authorGravatar Derek Murray <mrry@google.com>2018-07-19 11:27:39 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-07-19 11:35:55 -0700
commit109ae67a7e99e3dcb4d93cc22df5b3912f4558c9 (patch)
tree7e8f56cba34b6d6bfb6be34610ab35a968dd0db0 /tensorflow/c/c_api.h
parentde6be2cbb1d2a179fc8abe984c21f968df627eaf (diff)
Expose each device's incarnation via `Session.list_devices()`.
PiperOrigin-RevId: 205273020
Diffstat (limited to 'tensorflow/c/c_api.h')
-rw-r--r--tensorflow/c/c_api.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/tensorflow/c/c_api.h b/tensorflow/c/c_api.h
index 1eb75ef11f..fddc09d45e 100644
--- a/tensorflow/c/c_api.h
+++ b/tensorflow/c/c_api.h
@@ -1521,6 +1521,13 @@ TF_CAPI_EXPORT extern const char* TF_DeviceListType(const TF_DeviceList* list,
TF_CAPI_EXPORT extern int64_t TF_DeviceListMemoryBytes(
const TF_DeviceList* list, int index, TF_Status* status);
+// Retrieve the incarnation number of a given device.
+//
+// If index is out of bounds, an error code will be set in the status object,
+// and 0 will be returned.
+TF_CAPI_EXPORT extern uint64_t TF_DeviceListIncarnation(
+ const TF_DeviceList* list, int index, TF_Status* status);
+
// --------------------------------------------------------------------------
// Load plugins containing custom ops and kernels