From 4a73fbec00fa4ecec7bceeff552a7c4056183a27 Mon Sep 17 00:00:00 2001 From: Saleel Kudchadker Date: Tue, 11 Apr 2023 21:04:22 -0700 Subject: [PATCH] SWDEV-355540 - Do not reset core affinities - Do not reset core affinities when spawning new threads Change-Id: I26a12075a1ff197bc217aafb9ba18ffbb019ef43 --- rocclr/os/os_posix.cpp | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/rocclr/os/os_posix.cpp b/rocclr/os/os_posix.cpp index 21b00e7ae8..c41c39d338 100644 --- a/rocclr/os/os_posix.cpp +++ b/rocclr/os/os_posix.cpp @@ -391,19 +391,6 @@ const void* Os::createOsThread(amd::Thread* thread) { // We never plan the use join, so free the resources now. ::pthread_attr_setdetachstate(&threadAttr, PTHREAD_CREATE_DETACHED); - if (!AMD_CPU_AFFINITY) { - ClPrint(amd::LOG_INFO, amd::LOG_INIT, "Resetting CPU core affinities"); - cpu_set_t cpuset; - if (processorCount_ > 0) { - CPU_ZERO(&cpuset); - for (int i = 0; i < processorCount_; i++) { - CPU_SET(i, &cpuset); - } - if (0 != pthread_attr_setaffinity_np(&threadAttr, sizeof(cpu_set_t), &cpuset)) { - fatal("pthread_attr_setaffinity_np failed to set affinity"); - } - } - } pthread_t handle = 0; if (0 != ::pthread_create(&handle, &threadAttr, (void* (*)(void*)) & Thread::entry, thread)) {