| 104 | } |
| 105 | |
| 106 | XrtTfContext::XrtTfContext(const XrtTfContext::Options& options, |
| 107 | std::shared_ptr<XrtTfClient> tf_client, |
| 108 | XrtGrpcEagerClient* eager_client, |
| 109 | int64 rendezvous_id, int64 context_id, |
| 110 | std::vector<DeviceAttributes> devices, |
| 111 | int cpu_device_id) |
| 112 | : options_(options), |
| 113 | tf_client_(tf_client), |
| 114 | eager_client_(eager_client), |
| 115 | rendezvous_id_(rendezvous_id), |
| 116 | context_id_(context_id), |
| 117 | devices_(std::move(devices)), |
| 118 | cpu_device_id_(cpu_device_id) { |
| 119 | CHECK_GE(cpu_device_id_, 0); |
| 120 | enqueue_request_ = absl::make_unique<eager::EnqueueRequest>(); |
| 121 | queue_thread_.reset(Env::Default()->StartThread(ThreadOptions(), |
| 122 | "xrt_tf_client_queue_thread", |
| 123 | [this]() { QueueThread(); })); |
| 124 | } |
| 125 | |
| 126 | XrtTfContext::~XrtTfContext() { |
| 127 | Status status = Close(); |
nothing calls this directly
no test coverage detected