| 44 | namespace grappler { |
| 45 | |
| 46 | DeviceProperties GetLocalCPUInfo() { |
| 47 | DeviceProperties device; |
| 48 | device.set_type("CPU"); |
| 49 | |
| 50 | device.set_vendor(port::CPUVendorIDString()); |
| 51 | // Combine cpu family and model into the model string. |
| 52 | device.set_model( |
| 53 | strings::StrCat((port::CPUFamily() << 4) + port::CPUModelNum())); |
| 54 | device.set_frequency(port::NominalCPUFrequency() * 1e-6); |
| 55 | device.set_num_cores(port::NumSchedulableCPUs()); |
| 56 | device.set_l1_cache_size(Eigen::l1CacheSize()); |
| 57 | device.set_l2_cache_size(Eigen::l2CacheSize()); |
| 58 | device.set_l3_cache_size(Eigen::l3CacheSize()); |
| 59 | |
| 60 | int64 free_mem = port::AvailableRam(); |
| 61 | if (free_mem < INT64_MAX) { |
| 62 | device.set_memory_size(free_mem); |
| 63 | } |
| 64 | |
| 65 | (*device.mutable_environment())["cpu_instruction_set"] = |
| 66 | Eigen::SimdInstructionSetsInUse(); |
| 67 | |
| 68 | (*device.mutable_environment())["eigen"] = strings::StrCat( |
| 69 | EIGEN_WORLD_VERSION, ".", EIGEN_MAJOR_VERSION, ".", EIGEN_MINOR_VERSION); |
| 70 | #ifdef TENSORFLOW_USE_LIBXSMM |
| 71 | (*device.mutable_environment())["libxsmm"] = LIBXSMM_VERSION; |
| 72 | #endif |
| 73 | |
| 74 | return device; |
| 75 | } |
| 76 | |
| 77 | DeviceProperties GetLocalGPUInfo(PlatformGpuId platform_gpu_id) { |
| 78 | DeviceProperties device; |
no test coverage detected