diff --git a/runtime/hsa-runtime/core/util/lnx/os_linux.cpp b/runtime/hsa-runtime/core/util/lnx/os_linux.cpp index e60036929a..6c27611519 100644 --- a/runtime/hsa-runtime/core/util/lnx/os_linux.cpp +++ b/runtime/hsa-runtime/core/util/lnx/os_linux.cpp @@ -74,7 +74,7 @@ void* __stdcall ThreadTrampoline(void* arg) { void* Data = ar->entry_args; delete ar; CallMe(Data); - return NULL; + return nullptr; } // Thread container allows multiple waits and separate close (destroy). @@ -99,7 +99,16 @@ class os_thread { assert(err == 0 && "pthread_attr_setstacksize failed."); } - int err = pthread_create(&thread, &attrib, ThreadTrampoline, args.get()); + int cores = get_nprocs_conf(); + cpu_set_t* cpuset = CPU_ALLOC(cores); + for(int i=0; i