Skip to content

Commit

Permalink
OFA: Add more Intel family numbers + kaby-lake
Browse files Browse the repository at this point in the history
Signed-off-by: Matthias Kretz <[email protected]>
  • Loading branch information
mattkretz committed Mar 20, 2017
1 parent 2b44d9d commit 2a2dbf1
Showing 1 changed file with 27 additions and 3 deletions.
30 changes: 27 additions & 3 deletions cmake/OptimizeForArchitecture.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,26 @@ macro(AutodetectHostArchitecture)
# 17 1D | Enhanced Intel Core microarchitecture
# 0F | Intel Core microarchitecture
#
# Intel SDM Vol. 3C 35-1 / December 2016:
# 57 | Xeon Phi 3200, 5200, 7200 [Knights Landing]
# 85 | Future Xeon Phi
# 8E 9E | 7th gen. Core [Kaby Lake]
# 55 | Future Xeon [Skylake w/ AVX512]
# 4E 5E | 6th gen. Core / E3 v5 [Skylake w/o AVX512]
# 56 | Xeon D-1500 [Broadwell]
# 4F | Xeon E5 v4, E7 v4, i7-69xx [Broadwell]
# 47 | 5th gen. Core / Xeon E3 v4 [Broadwell]
# 3D | M-5xxx / 5th gen. [Broadwell]
# 3F | Xeon E5 v3, E7 v3, i7-59xx [Haswell-E]
# 3C 45 46 | 4th gen. Core, Xeon E3 v3 [Haswell]
# 3E | Xeon E5 v2, E7 v2, i7-49xx [Ivy Bridge-E]
# 3A | 3rd gen. Core, Xeon E3 v2 [Ivy Bridge]
# 2D | Xeon E5, i7-39xx [Sandy Bridge]
# 2F | Xeon E7
# 2A | Xeon E3, 2nd gen. Core [Sandy Bridge]
# 2E | Xeon 7500, 6500 series
# 25 2C | Xeon 3600, 5600 series, Core i7, i5 and i3
#
# Values from the Intel SDE:
# 5C | Goldmont
# 5A | Silvermont
Expand All @@ -107,19 +127,21 @@ macro(AutodetectHostArchitecture)
# 4E | Skylake Client
# 3C | Broadwell (likely a bug in the SDE)
# 3C | Haswell
if(_cpu_model EQUAL 87)
if(_cpu_model EQUAL 87) # 57
set(TARGET_ARCHITECTURE "knl") # Knights Landing
elseif(_cpu_model EQUAL 92)
set(TARGET_ARCHITECTURE "goldmont")
elseif(_cpu_model EQUAL 90 OR _cpu_model EQUAL 76)
set(TARGET_ARCHITECTURE "silvermont")
elseif(_cpu_model EQUAL 102)
set(TARGET_ARCHITECTURE "cannonlake")
elseif(_cpu_model EQUAL 142 OR _cpu_model EQUAL 158) # 8E, 9E
set(TARGET_ARCHITECTURE "kaby-lake")
elseif(_cpu_model EQUAL 85) # 55
set(TARGET_ARCHITECTURE "skylake-avx512")
elseif(_cpu_model EQUAL 78 OR _cpu_model EQUAL 94) # 4E, 5E
set(TARGET_ARCHITECTURE "skylake")
elseif(_cpu_model EQUAL 61 OR _cpu_model EQUAL 71 OR _cpu_model EQUAL 86)
elseif(_cpu_model EQUAL 61 OR _cpu_model EQUAL 71 OR _cpu_model EQUAL 79 OR _cpu_model EQUAL 86) # 3D, 47, 4F, 56
set(TARGET_ARCHITECTURE "broadwell")
elseif(_cpu_model EQUAL 60 OR _cpu_model EQUAL 69 OR _cpu_model EQUAL 70 OR _cpu_model EQUAL 63)
set(TARGET_ARCHITECTURE "haswell")
Expand Down Expand Up @@ -183,7 +205,7 @@ Using an incorrect setting here can result in crashes of the resulting binary be
Setting the value to \"auto\" will try to optimize for the architecture where cmake is called. \
Other supported values are: \"none\", \"generic\", \"core\", \"merom\" (65nm Core2), \
\"penryn\" (45nm Core2), \"nehalem\", \"westmere\", \"sandy-bridge\", \"ivy-bridge\", \
\"haswell\", \"broadwell\", \"skylake\", \"skylake-avx512\", \"cannonlake\", \"silvermont\", \
\"haswell\", \"broadwell\", \"skylake\", \"skylake-xeon\", \"kaby-lake\", \"cannonlake\", \"silvermont\", \
\"goldmont\", \"knl\" (Knights Landing), \"atom\", \"k8\", \"k8-sse3\", \"barcelona\", \
\"istanbul\", \"magny-cours\", \"bulldozer\", \"interlagos\", \"piledriver\", \
\"AMD 14h\", \"AMD 16h\".")
Expand Down Expand Up @@ -287,6 +309,8 @@ Other supported values are: \"none\", \"generic\", \"core\", \"merom\" (65nm Cor
_knightslanding()
elseif(TARGET_ARCHITECTURE STREQUAL "cannonlake")
_cannonlake()
elseif(TARGET_ARCHITECTURE STREQUAL "kaby-lake")
_skylake()
elseif(TARGET_ARCHITECTURE STREQUAL "skylake-xeon" OR TARGET_ARCHITECTURE STREQUAL "skylake-avx512")
_skylake_avx512()
elseif(TARGET_ARCHITECTURE STREQUAL "skylake")
Expand Down

0 comments on commit 2a2dbf1

Please sign in to comment.