You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix incorrect CPU topology initialization (#3304) (#3487)
The error handling in the global object that defines CPU topology in oneDAL/DAAL and in global daal::services::Environment object was improved.
Several related bugs were fixed.
- cpp/daal/src/services/service_topo.h and cpp/daal/src/services/service_topo.cpp files re-worked to make it less error prone.
- The logic in setChkProcessAffinityConsistency() was changed to allow affinity masks that contain zeros. Previously having the process affinity mask with zeros lead to undefined behavior because the global object that defines CPU topology ended up in non-initialized state in that case.
- Out-of-bound memory access issues in CPU topology initialization were fixed.
- The constructor of daal::services::Environment class was updated to always call getCpuId() method which initializes the Environment instance. Without this call an uninitialized version of Environment might be used.
- The behavior of daal::services::Environment::getInstance() function that returns the pointer to a global DAAL's Environment object was changed. Now the function returns nullptr in case the global Environment object is uninitialized. The respective null pointer checks were added into the calling code.
- The behavior of daal::services::Environment::initNumberOfThreads() was changed to handle the case of hyper-threading correctly, setting the maximal number of threads available to oneDAL equal to the number of physical CPU cores.
0 commit comments