Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RX] fix hwloc warning #2556

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion xmrstak/backend/cpu/hwlocMemory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,24 @@

#include <hwloc.h>

static __hwloc_inline int
xmrstak_set_membind_nodeset(hwloc_topology_t topology, hwloc_const_nodeset_t nodeset, hwloc_membind_policy_t policy, int flags)
{
#if HWLOC_API_VERSION >= 0x20000
return hwloc_set_membind(
topology,
nodeset,
policy,
flags| HWLOC_MEMBIND_BYNODESET);
#else
return hwloc_set_membind_nodeset(
topology,
nodeset,
policy,
flags);
#endif
}

/** pin memory to NUMA node
*
* Set the default memory policy for the current thread to bind memory to the
Expand Down Expand Up @@ -37,7 +55,7 @@ void bindMemoryToNUMANode(size_t puId)
hwloc_obj_t pu = hwloc_get_obj_by_depth(topology, depth, i);
if(pu->os_index == puId)
{
if(0 > hwloc_set_membind_nodeset(
if(0 > xmrstak_set_membind_nodeset(
topology,
pu->nodeset,
HWLOC_MEMBIND_BIND,
Expand Down