Extended "numa" option for RandomX.
This commit is contained in:
parent
f34031a984
commit
7508411faf
8 changed files with 189 additions and 55 deletions
|
@ -46,7 +46,6 @@
|
|||
namespace xmrig {
|
||||
|
||||
|
||||
std::vector<uint32_t> HwlocCpuInfo::m_nodeIndexes;
|
||||
uint32_t HwlocCpuInfo::m_features = 0;
|
||||
|
||||
|
||||
|
@ -185,11 +184,11 @@ xmrig::HwlocCpuInfo::HwlocCpuInfo()
|
|||
m_features |= SET_THISTHREAD_MEMBIND;
|
||||
}
|
||||
|
||||
m_nodeIndexes.reserve(m_nodes);
|
||||
m_nodeset.reserve(m_nodes);
|
||||
hwloc_obj_t node = nullptr;
|
||||
|
||||
while ((node = hwloc_get_next_obj_by_type(m_topology, HWLOC_OBJ_NUMANODE, node)) != nullptr) {
|
||||
m_nodeIndexes.emplace_back(node->os_index);
|
||||
m_nodeset.emplace_back(node->os_index);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -52,7 +52,9 @@ public:
|
|||
~HwlocCpuInfo() override;
|
||||
|
||||
static inline bool has(Feature feature) { return m_features & feature; }
|
||||
static inline const std::vector<uint32_t> &nodeIndexes() { return m_nodeIndexes; }
|
||||
|
||||
inline const std::vector<uint32_t> &nodeset() const { return m_nodeset; }
|
||||
inline hwloc_topology_t topology() const { return m_topology; }
|
||||
|
||||
protected:
|
||||
CpuThreads threads(const Algorithm &algorithm, uint32_t limit) const override;
|
||||
|
@ -67,7 +69,7 @@ protected:
|
|||
private:
|
||||
void processTopLevelCache(hwloc_obj_t obj, const Algorithm &algorithm, CpuThreads &threads, size_t limit) const;
|
||||
|
||||
static std::vector<uint32_t> m_nodeIndexes;
|
||||
|
||||
static uint32_t m_features;
|
||||
|
||||
char m_backend[20] = { 0 };
|
||||
|
@ -76,6 +78,7 @@ private:
|
|||
size_t m_cores = 0;
|
||||
size_t m_nodes = 0;
|
||||
size_t m_packages = 0;
|
||||
std::vector<uint32_t> m_nodeset;
|
||||
};
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue