Better method to get hwloc version.

This commit is contained in:
XMRig 2019-07-23 14:19:41 +07:00
parent 73558a0eaa
commit a6a0995d54
11 changed files with 35 additions and 29 deletions

View file

@ -42,18 +42,6 @@
static xmrig::ICpuInfo *cpuInfo = nullptr;
const char *xmrig::Cpu::backend()
{
# if defined(XMRIG_FEATURE_HWLOC)
return "hwloc";
# elif defined(XMRIG_FEATURE_LIBCPUID)
return "libcpuid";
# else
return "basic";
# endif
}
xmrig::ICpuInfo *xmrig::Cpu::info()
{
assert(cpuInfo != nullptr);
@ -82,7 +70,7 @@ rapidjson::Value xmrig::Cpu::toJSON(rapidjson::Document &doc)
cpu.AddMember("threads", static_cast<uint64_t>(i->threads()), allocator);
cpu.AddMember("packages", static_cast<uint64_t>(i->packages()), allocator);
cpu.AddMember("nodes", static_cast<uint64_t>(i->nodes()), allocator);
cpu.AddMember("backend", StringRef(backend()), allocator);
cpu.AddMember("backend", StringRef(i->backend()), allocator);
return cpu;
}