| 42 | } |
| 43 | |
| 44 | void DeviceBase::set_eigen_cpu_device(Eigen::ThreadPoolDevice* d) { |
| 45 | // Eigen::ThreadPoolDevice is a very cheap struct (two pointers and |
| 46 | // an int). Therefore, we can afford a pre-allocated array of |
| 47 | // Eigen::ThreadPoolDevice. Here, we ensure that |
| 48 | // Eigen::ThreadPoolDevices in eigen_cpu_devices_ has increasingly |
| 49 | // larger numThreads. |
| 50 | for (int i = 1; i <= d->numThreads(); ++i) { |
| 51 | eigen_cpu_devices_.push_back(new Eigen::ThreadPoolDevice( |
| 52 | d->getPool(), i /* numThreads() */, d->allocator())); |
| 53 | } |
| 54 | } |
| 55 | |
| 56 | void DeviceBase::set_tensorflow_gpu_device_info(GpuDeviceInfo* g) { |
| 57 | VLOG(1) << "GpuDeviceInfo is SET "; |