@@ -27,15 +27,18 @@ namespace xgboost::common {
2727
2828namespace {
2929namespace fs = std::filesystem;
30+
31+ using MaskT = unsigned long ; // NOLINT
32+
3033#if defined(__linux__)
3134// Wrapper for the system call
32- auto GetMemPolicy (int *mode, unsigned long *nodemask, unsigned long maxnode, void *addr, // NOLINT
33- unsigned long flags) { // NOLINT
35+ auto GetMemPolicy (int *mode, MaskT *nodemask, unsigned long maxnode, void *addr, // NOLINT
36+ unsigned long flags) { // NOLINT
3437 return syscall (SYS_get_mempolicy, mode, nodemask, maxnode, addr, flags);
3538}
3639
37- auto GetMemPolicy (int *policy, unsigned long *nmask , unsigned long maxnode) { // NOLINT
38- return GetMemPolicy (policy, nmask , maxnode, nullptr , 0 );
40+ auto GetMemPolicy (int *policy, MaskT *nodemask , unsigned long maxnode) { // NOLINT
41+ return GetMemPolicy (policy, nodemask , maxnode, nullptr , 0 );
3942}
4043#endif // defined(__linux__)
4144} // namespace
@@ -109,7 +112,7 @@ void GetNumaNodeCpus(std::int32_t node_id, std::vector<std::int32_t> *p_cpus) {
109112 // Estimate the size of the CPU set based on the error returned from get mempolicy.
110113 // Strategy used by hwloc and libnuma.
111114 while (true ) {
112- std::vector<std:: uint64_t > mask (max_n_nodes, 0 );
115+ std::vector<MaskT > mask (max_n_nodes, 0 );
113116
114117 std::int32_t mode = -1 ;
115118 auto err = GetMemPolicy (&mode, mask.data (), max_n_nodes);
@@ -135,7 +138,7 @@ void GetNumaNodeCpus(std::int32_t node_id, std::vector<std::int32_t> *p_cpus) {
135138 if (max_n_nodes <= 0 ) {
136139 return false ;
137140 }
138- std::vector<std:: uint64_t > mask (max_n_nodes / 8 );
141+ std::vector<MaskT > mask (max_n_nodes / 8 );
139142 CHECK_GE (GetMemPolicy (&mode, mask.data (), max_n_nodes), 0 ) << error::SystemError ().message ();
140143 return mode == MPOL_BIND;
141144#else
0 commit comments