Home | History | Annotate | Download | only in optimizers

Lines Matching defs:device

73   for (const DeviceType& device : devices) {
75 Status s = FindKernelDef(device, node, &kernel, nullptr);
133 // Check if op's device is on CPU.
134 if (str_util::StrContains(node.device(), DEVICE_CPU)) {
158 s = TryFindKernelDef({node.device().c_str(), DEVICE_GPU, DEVICE_CPU}, node,
180 if (str_util::StrContains(node.device(), DEVICE_CPU)) {
196 {node.device().c_str(), DEVICE_GPU, DEVICE_CPU}, node, &kernel);
223 if (str_util::StrContains(node.device(), DEVICE_CPU)) {
266 // Tries to find a Host device from `devices`. Returns empty string if no
267 // matching Host device is found.
269 bool has_device_cpu, const string& device) {
271 if (device.empty() && has_device_cpu) {
272 return "/device:CPU:0";
273 } else if (str_util::StrContains(device, DEVICE_GPU)) {
275 // devices = {"/device:CPU:0", "/device:XLA_GPU:0"}
279 std::pair<string, string>("/device", "/device:CPU:0")}) {
281 strings::StrCat(device.substr(0, device.rfind(device_match.first)),
289 // We couldn't find an appropriate Host device, return no device.
321 devices = {"/device:CPU:0"};
324 const bool has_device_cpu = devices.find("/device:CPU:0") != devices.end();
342 string device =
343 internal::TryFindHostDevice(devices, has_device_cpu, node.device());
344 if (!device.empty()) {
347 const_nodes.emplace_back(&node, node.device());
349 *node.mutable_device() = std::move(device);
357 const string& device = it.second;
360 // this node back onto the original device.
362 // The consumer is not Host friendly, swap it back to the original device.
365 node->set_device(device);