mirror of
https://github.com/xmrig/xmrig.git
synced 2024-11-18 10:01:06 +00:00
Replacement for PR #1087
This commit is contained in:
parent
962f0cdd8e
commit
c138161ee2
2 changed files with 21 additions and 1 deletions
|
@ -32,6 +32,12 @@
|
||||||
#include <hwloc.h>
|
#include <hwloc.h>
|
||||||
|
|
||||||
|
|
||||||
|
#if HWLOC_API_VERSION < 0x00010b00
|
||||||
|
# define HWLOC_OBJ_PACKAGE HWLOC_OBJ_SOCKET
|
||||||
|
# define HWLOC_OBJ_NUMANODE HWLOC_OBJ_NODE
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#include "backend/cpu/platform/HwlocCpuInfo.h"
|
#include "backend/cpu/platform/HwlocCpuInfo.h"
|
||||||
#include "base/io/log/Log.h"
|
#include "base/io/log/Log.h"
|
||||||
|
|
||||||
|
@ -152,7 +158,17 @@ xmrig::HwlocCpuInfo::HwlocCpuInfo() : BasicCpuInfo(),
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
hwloc_obj_t root = hwloc_get_root_obj(m_topology);
|
hwloc_obj_t root = hwloc_get_root_obj(m_topology);
|
||||||
snprintf(m_backend, sizeof m_backend, "hwloc/%s", hwloc_obj_get_info_by_name(root, "hwlocVersion"));
|
|
||||||
|
# if HWLOC_API_VERSION >= 0x00010b00
|
||||||
|
const char *version = hwloc_obj_get_info_by_name(root, "hwlocVersion");
|
||||||
|
if (version) {
|
||||||
|
snprintf(m_backend, sizeof m_backend, "hwloc/%s", version);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
# endif
|
||||||
|
{
|
||||||
|
snprintf(m_backend, sizeof m_backend, "hwloc");
|
||||||
|
}
|
||||||
|
|
||||||
findCache(root, 2, 3, [this](hwloc_obj_t found) { this->m_cache[found->attr->cache.depth] += found->attr->cache.size; });
|
findCache(root, 2, 3, [this](hwloc_obj_t found) { this->m_cache[found->attr->cache.depth] += found->attr->cache.size; });
|
||||||
|
|
||||||
|
|
|
@ -28,6 +28,10 @@
|
||||||
#ifdef XMRIG_FEATURE_HWLOC
|
#ifdef XMRIG_FEATURE_HWLOC
|
||||||
# include <hwloc.h>
|
# include <hwloc.h>
|
||||||
# include "backend/cpu/platform/HwlocCpuInfo.h"
|
# include "backend/cpu/platform/HwlocCpuInfo.h"
|
||||||
|
#
|
||||||
|
# if HWLOC_API_VERSION < 0x00010b00
|
||||||
|
# define HWLOC_OBJ_NUMANODE HWLOC_OBJ_NODE
|
||||||
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue