Skip to content

Commit ed01f49

Browse files
authored
Merge pull request #1946 from martin-frbg/issue1908
More fixes for cross-compiling ARM64 targets
2 parents 20d1aad + 802f0db commit ed01f49

File tree

1 file changed

+31
-14
lines changed

1 file changed

+31
-14
lines changed

cmake/prebuild.cmake

Lines changed: 31 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -87,13 +87,18 @@ endif ()
8787
# Cannot run getarch on target if we are cross-compiling
8888
if (DEFINED CORE AND CMAKE_CROSSCOMPILING AND NOT (${HOST_OS} STREQUAL "WINDOWSSTORE"))
8989
# Write to config as getarch would
90+
if (DEFINED TARGET_CORE)
91+
set(TCORE ${TARGET_CORE})
92+
else()
93+
set(TCORE ${CORE})
94+
endif()
9095

9196
# TODO: Set up defines that getarch sets up based on every other target
9297
# Perhaps this should be inside a different file as it grows larger
9398
file(APPEND ${TARGET_CONF_TEMP}
94-
"#define ${CORE}\n"
95-
"#define CHAR_CORENAME \"${CORE}\"\n")
96-
if ("${CORE}" STREQUAL "ARMV7")
99+
"#define ${TCORE}\n"
100+
"#define CHAR_CORENAME \"${TCORE}\"\n")
101+
if ("${TCORE}" STREQUAL "ARMV7")
97102
file(APPEND ${TARGET_CONF_TEMP}
98103
"#define L1_DATA_SIZE\t65536\n"
99104
"#define L1_DATA_LINESIZE\t32\n"
@@ -108,7 +113,7 @@ if (DEFINED CORE AND CMAKE_CROSSCOMPILING AND NOT (${HOST_OS} STREQUAL "WINDOWSS
108113
set(SGEMM_UNROLL_N 4)
109114
set(DGEMM_UNROLL_M 4)
110115
set(DGEMM_UNROLL_N 4)
111-
elseif ("${CORE}" STREQUAL "ARMV8")
116+
elseif ("${TCORE}" STREQUAL "ARMV8")
112117
file(APPEND ${TARGET_CONF_TEMP}
113118
"#define L1_DATA_SIZE\t32768\n"
114119
"#define L1_DATA_LINESIZE\t64\n"
@@ -118,9 +123,16 @@ if (DEFINED CORE AND CMAKE_CROSSCOMPILING AND NOT (${HOST_OS} STREQUAL "WINDOWSS
118123
"#define DTB_SIZE\t4096\n"
119124
"#define L2_ASSOCIATIVE\t32\n"
120125
"#define ARMV8\n")
121-
set(SGEMM_UNROLL_M 4)
126+
set(SGEMM_UNROLL_M 16)
122127
set(SGEMM_UNROLL_N 4)
123-
elseif ("${CORE}" STREQUAL "CORTEXA57" OR "${CORE}" STREQUAL "CORTEXA53")
128+
set(DGEMM_UNROLL_M 8)
129+
set(DGEMM_UNROLL_N 4)
130+
set(CGEMM_UNROLL_M 8)
131+
set(CGEMM_UNROLL_N 4)
132+
set(ZGEMM_UNROLL_M 4)
133+
set(ZGEMM_UNROLL_N 4)
134+
set(SYMV_P 16)
135+
elseif ("${TCORE}" STREQUAL "CORTEXA57" OR "${TCORE}" STREQUAL "CORTEXA53")
124136
file(APPEND ${TARGET_CONF_TEMP}
125137
"#define L1_CODE_SIZE\t32768\n"
126138
"#define L1_CODE_LINESIZE\t64\n"
@@ -144,9 +156,10 @@ if (DEFINED CORE AND CMAKE_CROSSCOMPILING AND NOT (${HOST_OS} STREQUAL "WINDOWSS
144156
set(DGEMM_UNROLL_N 4)
145157
set(CGEMM_UNROLL_M 8)
146158
set(CGEMM_UNROLL_N 4)
147-
set(ZGEMM_UNROLL_M 8)
159+
set(ZGEMM_UNROLL_M 4)
148160
set(ZGEMM_UNROLL_N 4)
149-
elseif ("${CORE}" STREQUAL "CORTEXA72" OR "${CORE}" STREQUAL "CORTEXA73")
161+
set(SYMV_P 16)
162+
elseif ("${TCORE}" STREQUAL "CORTEXA72" OR "${TCORE}" STREQUAL "CORTEXA73")
150163
file(APPEND ${TARGET_CONF_TEMP}
151164
"#define L1_CODE_SIZE\t49152\n"
152165
"#define L1_CODE_LINESIZE\t64\n"
@@ -170,9 +183,10 @@ if (DEFINED CORE AND CMAKE_CROSSCOMPILING AND NOT (${HOST_OS} STREQUAL "WINDOWSS
170183
set(DGEMM_UNROLL_N 4)
171184
set(CGEMM_UNROLL_M 8)
172185
set(CGEMM_UNROLL_N 4)
173-
set(ZGEMM_UNROLL_M 8)
186+
set(ZGEMM_UNROLL_M 4)
174187
set(ZGEMM_UNROLL_N 4)
175-
elseif ("${CORE}" STREQUAL "FALKOR")
188+
set(SYMV_P 16)
189+
elseif ("${TCORE}" STREQUAL "FALKOR")
176190
file(APPEND ${TARGET_CONF_TEMP}
177191
"#define L1_CODE_SIZE\t65536\n"
178192
"#define L1_CODE_LINESIZE\t64\n"
@@ -196,9 +210,10 @@ if (DEFINED CORE AND CMAKE_CROSSCOMPILING AND NOT (${HOST_OS} STREQUAL "WINDOWSS
196210
set(DGEMM_UNROLL_N 4)
197211
set(CGEMM_UNROLL_M 8)
198212
set(CGEMM_UNROLL_N 4)
199-
set(ZGEMM_UNROLL_M 8)
213+
set(ZGEMM_UNROLL_M 4)
200214
set(ZGEMM_UNROLL_N 4)
201-
elseif ("${CORE}" STREQUAL "THUNDERX")
215+
set(SYMV_P 16)
216+
elseif ("${TCORE}" STREQUAL "THUNDERX")
202217
file(APPEND ${TARGET_CONF_TEMP}
203218
"#define L1_CODE_SIZE\t32768\n"
204219
"#define L1_CODE_LINESIZE\t64\n"
@@ -224,7 +239,8 @@ if (DEFINED CORE AND CMAKE_CROSSCOMPILING AND NOT (${HOST_OS} STREQUAL "WINDOWSS
224239
set(CGEMM_UNROLL_N 2)
225240
set(ZGEMM_UNROLL_M 2)
226241
set(ZGEMM_UNROLL_N 2)
227-
elseif ("${CORE}" STREQUAL "THUNDERX2T99")
242+
set(SYMV_P 16)
243+
elseif ("${TCORE}" STREQUAL "THUNDERX2T99")
228244
file(APPEND ${TARGET_CONF_TEMP}
229245
"#define L1_CODE_SIZE\t32768\n"
230246
"#define L1_CODE_LINESIZE\t64\n"
@@ -240,7 +256,7 @@ if (DEFINED CORE AND CMAKE_CROSSCOMPILING AND NOT (${HOST_OS} STREQUAL "WINDOWSS
240256
"#define L3_ASSOCIATIVE\t32\n"
241257
"#define DTB_DEFAULT_ENTRIES\t64\n"
242258
"#define DTB_SIZE\t4096\n"
243-
"#define VULCAN\n")
259+
"#define ARMV8\n")
244260
set(SGEMM_UNROLL_M 16)
245261
set(SGEMM_UNROLL_N 4)
246262
set(DGEMM_UNROLL_M 8)
@@ -249,6 +265,7 @@ if (DEFINED CORE AND CMAKE_CROSSCOMPILING AND NOT (${HOST_OS} STREQUAL "WINDOWSS
249265
set(CGEMM_UNROLL_N 4)
250266
set(ZGEMM_UNROLL_M 4)
251267
set(ZGEMM_UNROLL_N 4)
268+
set(SYMV_P 16)
252269
endif()
253270

254271
# Or should this actually be NUM_CORES?

0 commit comments

Comments
 (0)