diff --git a/projects/rocr-runtime/runtime/hsa-runtime/core/util/lnx/os_linux.cpp b/projects/rocr-runtime/runtime/hsa-runtime/core/util/lnx/os_linux.cpp index 87b676413f..afa71bd5cd 100644 --- a/projects/rocr-runtime/runtime/hsa-runtime/core/util/lnx/os_linux.cpp +++ b/projects/rocr-runtime/runtime/hsa-runtime/core/util/lnx/os_linux.cpp @@ -103,6 +103,7 @@ class os_thread { if (core::Runtime::runtime_singleton_->flag().override_cpu_affinity()) { int cores = get_nprocs_conf(); cpu_set_t* cpuset = CPU_ALLOC(cores); + CPU_ZERO_S(CPU_ALLOC_SIZE(cores), cpuset); for (int i = 0; i < cores; i++) { CPU_SET(i, cpuset); }