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

Method RenamedDevice

tensorflow/core/common_runtime/renamed_device.cc:50–70  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

48}
49
50RenamedDevice::RenamedDevice(Device* underlying,
51 const DeviceAttributes& attributes,
52 bool owns_underlying_device,
53 bool isolate_session_state,
54 thread::ThreadPoolInterface* underlying_threadpool)
55 : Device(underlying->env(), attributes),
56 underlying_device_(underlying),
57 owns_underlying_device_(owns_underlying_device),
58 isolate_session_state_(isolate_session_state) {
59 if (underlying_threadpool != nullptr) {
60 underlying_threadpool_.reset(new thread::ThreadPool(underlying_threadpool));
61 eigen_worker_threads_.workers = underlying_threadpool_.get();
62 eigen_worker_threads_.num_threads = underlying_threadpool->NumThreads();
63 set_tensorflow_cpu_worker_threads(&eigen_worker_threads_);
64 set_tensorflow_device_thread_pool(underlying_threadpool_.get());
65
66 Eigen::ThreadPoolDevice eigen_threadpool_device(
67 underlying_threadpool, underlying_threadpool->NumThreads());
68 set_eigen_cpu_device(&eigen_threadpool_device);
69 }
70}
71
72RenamedDevice::~RenamedDevice() {
73 if (owns_underlying_device_) {

Callers

nothing calls this directly

Calls 5

envMethod · 0.45
resetMethod · 0.45
getMethod · 0.45
NumThreadsMethod · 0.45

Tested by

no test coverage detected