diff options
author | MITSUNARI Shigeo <[email protected]> | 2019-03-06 10:21:58 +0900 |
---|---|---|
committer | MITSUNARI Shigeo <[email protected]> | 2019-03-06 10:21:58 +0900 |
commit | 801cf3fd614f064b1f69349ef443107ef133b03d (patch) | |
tree | 768d1489fb49ea60beafb4e57fe20b21223fff36 | |
parent | d397e824f42f68a60c7986d70d9313a1e92bd49a (diff) | |
download | xbyak-801cf3fd614f064b1f69349ef443107ef133b03d.tar.gz xbyak-801cf3fd614f064b1f69349ef443107ef133b03d.zip |
cosmetic change of getNumCores
-rw-r--r-- | xbyak/xbyak_util.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/xbyak/xbyak_util.h b/xbyak/xbyak_util.h index 13f4693..c2474c5 100644 --- a/xbyak/xbyak_util.h +++ b/xbyak/xbyak_util.h @@ -200,11 +200,12 @@ public: int displayModel; // model + extModel unsigned int getNumCores(IntelCpuTopologyLevel level) { - if (level != SmtLevel && level != CoreLevel) throw Error(ERR_BAD_PARAMETER); if (!x2APIC_supported_) throw Error(ERR_X2APIC_IS_NOT_SUPPORTED); - return (level == CoreLevel) - ? numCores_[level - 1] / numCores_[SmtLevel - 1] - : numCores_[level - 1]; + switch (level) { + case SmtLevel: return numCores_[level - 1]; + case CoreLevel: return numCores_[level - 1] / numCores_[SmtLevel - 1]; + default: throw Error(ERR_X2APIC_IS_NOT_SUPPORTED); + } } unsigned int getDataCacheLevels() const { return dataCacheLevels_; } |