1 | #include <ogdf/basic/basic.h> |
---|---|
2 | #include <ogdf/basic/System.h> |
3 | |
4 | using namespace ogdf; |
5 | |
6 | const char *yn(bool b) |
7 | { |
8 | return b ? "yes": "no"; |
9 | } |
10 | |
11 | int main() |
12 | { |
13 | std::cout |
14 | << "---------------------------------------"<< std::endl |
15 | << " System-specific information "<< std::endl |
16 | << "---------------------------------------"<< std::endl |
17 | << std::endl |
18 | |
19 | << "Cache / processors:"<< std::endl |
20 | << "-------------------"<< std::endl |
21 | << "Processors: "<< System::numberOfProcessors() << std::endl |
22 | << "L2-Cache: "<< System::cacheSizeKBytes() << " KBytes"<< std::endl |
23 | << "Cache-Line: "<< System::cacheLineBytes() << " Bytes"<< std::endl |
24 | << std::endl |
25 | |
26 | << "Supported technologies:"<< std::endl |
27 | << "-----------------------"<< std::endl |
28 | << "MMX: "<< yn(System::cpuSupports(CPUFeature::MMX)) << std::endl |
29 | << "SSE: "<< yn(System::cpuSupports(CPUFeature::SSE)) << std::endl |
30 | << "SSE2: "<< yn(System::cpuSupports(CPUFeature::SSE2)) << std::endl |
31 | << "SSE3: "<< yn(System::cpuSupports(CPUFeature::SSE3)) << std::endl |
32 | << "SSSE3: "<< yn(System::cpuSupports(CPUFeature::SSSE3)) << std::endl |
33 | << "SSE4.1: "<< yn(System::cpuSupports(CPUFeature::SSE4_1)) << std::endl |
34 | << "SSE4.2: "<< yn(System::cpuSupports(CPUFeature::SSE4_2)) << std::endl |
35 | << "VMX: "<< yn(System::cpuSupports(CPUFeature::VMX)) << std::endl |
36 | << "SMX: "<< yn(System::cpuSupports(CPUFeature::SMX)) << std::endl |
37 | << "EST: "<< yn(System::cpuSupports(CPUFeature::EST)) << std::endl |
38 | << std::endl |
39 | |
40 | << "Memory management:"<< std::endl |
41 | << "------------------"<< std::endl |
42 | << "Total physical memory: "<< System::physicalMemory() / 1024 / 1024 << " MBytes"<< std::endl |
43 | << " available: "<< System::availablePhysicalMemory() / 1024 / 1024 << " MBytes"<< std::endl |
44 | << " used by process: "<< System::memoryUsedByProcess() / 1024 << " KBytes"<< std::endl |
45 | #if defined(OGDF_SYSTEM_WINDOWS) || defined(__CYGWIN__) |
46 | << " peak amount: "<< System::peakMemoryUsedByProcess() / 1024 << " KBytes"<< std::endl |
47 | #endif |
48 | << std::endl |
49 | << "allocated by malloc: "<< System::memoryAllocatedByMalloc() / 1024 << " KBytes"<< std::endl |
50 | << " in freelist: "<< System::memoryInFreelistOfMalloc() / 1024 << " KBytes"<< std::endl |
51 | << std::endl |
52 | << "allocated by OGDF: "<< System::memoryAllocatedByMemoryManager() / 1024 << " KBytes"<< std::endl |
53 | << " in global freelist: "<< System::memoryInGlobalFreeListOfMemoryManager() / 1024 << " KBytes"<< std::endl |
54 | << " in thread freelist: "<< System::memoryInThreadFreeListOfMemoryManager() / 1024 << " KBytes"<< std::endl; |
55 | |
56 | return 0; |
57 | } |
58 |