MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / GetDeviceHandles

Method GetDeviceHandles

tensorflow/compiler/xla/client/client.cc:365–388  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

363}
364
365StatusOr<std::vector<DeviceHandle>> Client::GetDeviceHandles(
366 int64 device_count) {
367 if (device_count < 1) {
368 return InvalidArgument("device_count must be greater than 0");
369 }
370 GetDeviceHandlesRequest request;
371 request.set_device_count(device_count);
372
373 GetDeviceHandlesResponse response;
374 VLOG(1) << "making get device request: " << request.ShortDebugString();
375 Status s = stub_->GetDeviceHandles(&request, &response);
376 VLOG(1) << "done with request";
377
378 if (!s.ok()) {
379 return s;
380 }
381
382 std::vector<DeviceHandle> device_handles;
383 for (const DeviceHandle& device_handle : response.device_handles()) {
384 device_handles.push_back(device_handle);
385 }
386
387 return device_handles;
388}
389
390Status Client::Unregister(const GlobalData& data) {
391 UnregisterRequest request;

Callers 2

XLA_TEST_FFunction · 0.45
XLA_TEST_FFunction · 0.45

Calls 4

InvalidArgumentFunction · 0.85
ShortDebugStringMethod · 0.45
okMethod · 0.45
push_backMethod · 0.45

Tested by 2

XLA_TEST_FFunction · 0.36
XLA_TEST_FFunction · 0.36