From f07b8f22502d7ec0f7fc364a472664766fa69578 Mon Sep 17 00:00:00 2001 From: David Yat Sin Date: Thu, 23 Nov 2023 20:57:14 +0000 Subject: [PATCH] Use CPU_SET_S instead of CPU_SET Fix incorrect use of CPU_SET on variable size cpu_set_t Suggested by Christopher E. Moore on github https://github.com/RadeonOpenCompute/ROCR-Runtime/issues/130 Change-Id: I710b56683ba07c08dcd83c851bf72e4f127a0ad4 --- runtime/hsa-runtime/core/util/lnx/os_linux.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/hsa-runtime/core/util/lnx/os_linux.cpp b/runtime/hsa-runtime/core/util/lnx/os_linux.cpp index f9f842cb5b..bdf76657eb 100644 --- a/runtime/hsa-runtime/core/util/lnx/os_linux.cpp +++ b/runtime/hsa-runtime/core/util/lnx/os_linux.cpp @@ -120,7 +120,7 @@ class os_thread { } CPU_ZERO_S(CPU_ALLOC_SIZE(cores), cpuset); for (int i = 0; i < cores; i++) { - CPU_SET(i, cpuset); + CPU_SET_S(i, CPU_ALLOC_SIZE(cores), cpuset); } err = pthread_attr_setaffinity_np(&attrib, CPU_ALLOC_SIZE(cores), cpuset); CPU_FREE(cpuset);