public final class Hardware extends CommonMachine implements Comparable<Hardware>
processors
, cores
and units
may be
incorrectly calculated if you fail to specify the caches. Known issue: If you have more than one processor,
nut no L3 cache; the processors
attribute will be incorrectly set 1. A workaround that
currently works is to define an L3 cache anyway and set the memory/size of that cache to 0bytes. This
workoround may stop working in the future.new MemoryThreads[] { SYSTEM, L3, L2, L1 }
or
new MemoryThreads[] { SYSTEM, L2, L1 }
or new MemoryThreads[] { SYSTEM, L1 }
Modifier and Type | Field and Description |
---|---|
static long |
CPU_CACHE_LINE_SIZE
Cache-line size is (typically) 64 bytes
|
static long |
OS_MEMORY_PAGE_SIZE
Practically all architectures/OS:s have a page size of 4k (one notable exception is Solaris/SPARC that
have 8k)
|
static Set<Hardware> |
PREDEFINED
Should contain all available hardware in ascending "power" order.
|
architecture, cache, cores, units
memory, threads
Constructor and Description |
---|
Hardware(String architecture,
BasicMachine[] levels)
new BasicMachine[] { SYSTEM, L3, L2, L1 } or
new BasicMachine[] { SYSTEM, L2, L1 } or in worst case
new BasicMachine[] { SYSTEM, L1 } |
Modifier and Type | Method and Description |
---|---|
int |
compareTo(Hardware other) |
boolean |
equals(Object obj) |
int |
hashCode() |
boolean |
isL2Specified() |
boolean |
isL3Specified() |
static Hardware |
makeSimple() |
static Hardware |
makeSimple(String systemArchitecture,
long systemMemory,
int systemThreads) |
String |
toString() |
VirtualMachine |
virtualise() |
countCores, countThreads, countUnits, getCacheElements, getMemoryElements, isMultiCore, isMultiThread, isMultiUnit
public static final long CPU_CACHE_LINE_SIZE
public static final long OS_MEMORY_PAGE_SIZE
public Hardware(String architecture, BasicMachine[] levels)
new BasicMachine[] { SYSTEM, L3, L2, L1 }
or
new BasicMachine[] { SYSTEM, L2, L1 }
or in worst case
new BasicMachine[] { SYSTEM, L1 }
public static Hardware makeSimple()
public static Hardware makeSimple(String systemArchitecture, long systemMemory, int systemThreads)
public int compareTo(Hardware other)
compareTo
in interface Comparable<Hardware>
public boolean equals(Object obj)
equals
in class CommonMachine
public int hashCode()
hashCode
in class CommonMachine
public boolean isL2Specified()
public boolean isL3Specified()
public String toString()
toString
in class BasicMachine
public VirtualMachine virtualise()
Copyright © 2022 Optimatika. All rights reserved.