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

Function GetLocalCPUInfo

tensorflow/core/grappler/clusters/utils.cc:46–75  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

44namespace grappler {
45
46DeviceProperties 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
77DeviceProperties GetLocalGPUInfo(PlatformGpuId platform_gpu_id) {
78 DeviceProperties device;

Callers 3

ProvisionMethod · 0.85
GetDeviceInfoFunction · 0.85
GetDeviceInfoFunction · 0.85

Calls 8

CPUVendorIDStringFunction · 0.85
CPUFamilyFunction · 0.85
CPUModelNumFunction · 0.85
StrCatFunction · 0.50
NominalCPUFrequencyFunction · 0.50
NumSchedulableCPUsFunction · 0.50
AvailableRamFunction · 0.50
set_modelMethod · 0.45

Tested by

no test coverage detected