| 129 | BENCHMARK(BM_Execute_Identity)->Arg(0)->Arg(1); |
| 130 | |
| 131 | TEST(CAPI, Context) { |
| 132 | TF_Status* status = TF_NewStatus(); |
| 133 | TFE_ContextOptions* opts = TFE_NewContextOptions(); |
| 134 | TFE_Context* ctx = TFE_NewContext(opts, status); |
| 135 | TFE_DeleteContextOptions(opts); |
| 136 | |
| 137 | TF_DeviceList* devices = TFE_ContextListDevices(ctx, status); |
| 138 | EXPECT_EQ(TF_OK, TF_GetCode(status)) << TF_Message(status); |
| 139 | |
| 140 | TFE_DeleteContext(ctx); |
| 141 | EXPECT_EQ(TF_OK, TF_GetCode(status)) << TF_Message(status); |
| 142 | |
| 143 | const int num_devices = TF_DeviceListCount(devices); |
| 144 | EXPECT_GE(num_devices, 1) << "At least one CPU device should exist"; |
| 145 | for (int i = 0; i < num_devices; ++i) { |
| 146 | EXPECT_NE("", TF_DeviceListName(devices, i, status)) << i; |
| 147 | EXPECT_EQ(TF_OK, TF_GetCode(status)) << TF_Message(status); |
| 148 | } |
| 149 | TF_DeleteDeviceList(devices); |
| 150 | TF_DeleteStatus(status); |
| 151 | } |
| 152 | |
| 153 | tensorflow::ServerDef GetServerDef(const string& job_name, int num_tasks) { |
| 154 | tensorflow::ServerDef server_def; |
nothing calls this directly
no test coverage detected