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

Method XrtContext

tensorflow/compiler/xrt/client/xrt_client.cc:498–509  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

496}
497
498XrtContext::XrtContext(std::shared_ptr<XrtTfContext> tf_context,
499 string device_type)
500 : tf_context_(std::move(tf_context)), device_type_(std::move(device_type)) {
501 for (int i = 0; i < tf_context_->devices().size(); ++i) {
502 const DeviceAttributes& device = tf_context_->devices()[i];
503 VLOG(2) << "Device: " << i << ": " << device.DebugString();
504 if (device.device_type() == device_type_) {
505 tf_device_ids_.push_back(i);
506 VLOG(1) << "Accelerator device " << i << ": " << device.name();
507 }
508 }
509}
510
511int XrtContext::device_count() const { return tf_device_ids_.size(); }
512

Callers

nothing calls this directly

Calls 6

nameMethod · 0.65
sizeMethod · 0.45
devicesMethod · 0.45
DebugStringMethod · 0.45
device_typeMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected