Skip to content

Commit

Permalink
fix wrong bitmask usage
Browse files Browse the repository at this point in the history
  • Loading branch information
dpower4 committed Nov 5, 2024
1 parent 41492d6 commit 49db162
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ int SetGpu(int gpu_id) {

// Check if its NUMA node has CPUs.
bool HasCPUsForNumaNode(int node) {
struct bitmask *bm = numa_allocate_nodemask();
struct bitmask *bm = numa_allocate_cpumask();

int numa_err = numa_node_to_cpus(node, bm);
if (numa_err != 0) {
Expand All @@ -328,7 +328,7 @@ bool HasCPUsForNumaNode(int node) {

// Check if any CPU is assigned to the NUMA node, has_cpus is false for mem only numa nodes
bool has_cpus = (numa_bitmask_weight(bm) > 0);
numa_bitmask_free(bm);
numa_free_cpumask(bm);
return has_cpus;
}

Expand Down

0 comments on commit 49db162

Please sign in to comment.