Skip to content

Commit b78d1dc

Browse files
authored
Merge pull request #5342 from martin-frbg/cmake_ampere
Add CMake build settings for the Ampere One cpu
2 parents 11ce79a + 560fa88 commit b78d1dc

File tree

2 files changed

+39
-0
lines changed

2 files changed

+39
-0
lines changed

cmake/cc.cmake

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,18 @@ if (${CORE} STREQUAL NEOVERSEN1)
236236
endif ()
237237
endif ()
238238

239+
if (${CORE} STREQUAL AMPEREONE)
240+
if (NOT DYNAMIC_ARCH)
241+
if (${CMAKE_C_COMPILER_ID} STREQUAL "NVC")
242+
set (CCOMMON_OPT "${CCOMMON_OPT} -tp=neoverse-n1")
243+
elseif (${GCC_VERSION} VERSION_GREATER 12.1)
244+
set (CCOMMON_OPT "${CCOMMON_OPT} -march=armv8.6-a+crypto+crc+fp16+sha3+rng -mtune=ampereone")
245+
else ()
246+
set (CCOMMON_OPT "${CCOMMON_OPT} -march=armv8.6-a+fp16")
247+
endif()
248+
endif ()
249+
endif ()
250+
239251
if (${CORE} STREQUAL ARMV8SVE)
240252
if (NOT DYNAMIC_ARCH)
241253
if (${CMAKE_C_COMPILER_ID} STREQUAL "PGI" AND NOT NO_SVE)

cmake/prebuild.cmake

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1195,6 +1195,33 @@ endif ()
11951195
set(ZGEMM_UNROLL_M 4)
11961196
set(ZGEMM_UNROLL_N 4)
11971197
set(SYMV_P 16)
1198+
elseif ("${TCORE}" STREQUAL "AMPEREONE")
1199+
file(APPEND ${TARGET_CONF_TEMP}
1200+
"#define L1_CODE_SIZE\t16384\n"
1201+
"#define L1_CODE_LINESIZE\t64\n"
1202+
"#define L1_CODE_ASSOCIATIVE\t4\n"
1203+
"#define L1_DATA_SIZE\t65536\n"
1204+
"#define L1_DATA_LINESIZE\t64\n"
1205+
"#define L1_DATA_ASSOCIATIVE\t4\n"
1206+
"#define L2_SIZE\t2097152\n\n"
1207+
"#define L2_LINESIZE\t64\n"
1208+
"#define L2_ASSOCIATIVE\t8\n"
1209+
"#define DTB_DEFAULT_ENTRIES\t64\n"
1210+
"#define DTB_SIZE\t4096\n"
1211+
"#define HAVE_VFPV4\n"
1212+
"#define HAVE_VFPV3\n"
1213+
"#define HAVE_VFP\n"
1214+
"#define HAVE_NEON\n"
1215+
"#define ARMV8\n")
1216+
set(SGEMM_UNROLL_M 16)
1217+
set(SGEMM_UNROLL_N 4)
1218+
set(DGEMM_UNROLL_M 8)
1219+
set(DGEMM_UNROLL_N 4)
1220+
set(CGEMM_UNROLL_M 8)
1221+
set(CGEMM_UNROLL_N 4)
1222+
set(ZGEMM_UNROLL_M 4)
1223+
set(ZGEMM_UNROLL_N 4)
1224+
set(SYMV_P 16)
11981225
elseif ("${TCORE}" STREQUAL "VORTEX")
11991226
file(APPEND ${TARGET_CONF_TEMP}
12001227
"#define ARMV8\n"

0 commit comments

Comments
 (0)