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

Function PickDeviceHelper

tensorflow/compiler/jit/device_util_test.cc:24–39  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

22namespace {
23
24Status PickDeviceHelper(bool allow_mixing_unknown_and_cpu,
25 absl::Span<const absl::string_view> device_names,
26 string* result) {
27 jit::DeviceInfoCache cache;
28 jit::DeviceSet device_set;
29 for (absl::string_view name : device_names) {
30 TF_ASSIGN_OR_RETURN(jit::DeviceId device_id, cache.GetIdFor(name));
31 device_set.Insert(device_id);
32 }
33
34 TF_ASSIGN_OR_RETURN(
35 jit::DeviceId result_id,
36 PickDeviceForXla(cache, device_set, allow_mixing_unknown_and_cpu));
37 *result = string(cache.GetNameFor(result_id));
38 return Status::OK();
39}
40
41void CheckPickDeviceResult(absl::string_view expected_result,
42 bool allow_mixing_unknown_and_cpu,

Callers 2

CheckPickDeviceResultFunction · 0.85
CheckPickDeviceHasErrorFunction · 0.85

Calls 2

GetNameForMethod · 0.80
InsertMethod · 0.45

Tested by

no test coverage detected