Merge pull request #1946 from martin-frbg/issue1908

More fixes for cross-compiling ARM64 targets
This commit is contained in:
Martin Kroeker 2019-01-04 01:37:37 +01:00 committed by GitHub
commit ed01f4932a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 31 additions and 14 deletions

View File

@ -87,13 +87,18 @@ endif ()
# Cannot run getarch on target if we are cross-compiling # Cannot run getarch on target if we are cross-compiling
if (DEFINED CORE AND CMAKE_CROSSCOMPILING AND NOT (${HOST_OS} STREQUAL "WINDOWSSTORE")) if (DEFINED CORE AND CMAKE_CROSSCOMPILING AND NOT (${HOST_OS} STREQUAL "WINDOWSSTORE"))
# Write to config as getarch would # Write to config as getarch would
if (DEFINED TARGET_CORE)
set(TCORE ${TARGET_CORE})
else()
set(TCORE ${CORE})
endif()
# TODO: Set up defines that getarch sets up based on every other target # TODO: Set up defines that getarch sets up based on every other target
# Perhaps this should be inside a different file as it grows larger # Perhaps this should be inside a different file as it grows larger
file(APPEND ${TARGET_CONF_TEMP} file(APPEND ${TARGET_CONF_TEMP}
"#define ${CORE}\n" "#define ${TCORE}\n"
"#define CHAR_CORENAME \"${CORE}\"\n") "#define CHAR_CORENAME \"${TCORE}\"\n")
if ("${CORE}" STREQUAL "ARMV7") if ("${TCORE}" STREQUAL "ARMV7")
file(APPEND ${TARGET_CONF_TEMP} file(APPEND ${TARGET_CONF_TEMP}
"#define L1_DATA_SIZE\t65536\n" "#define L1_DATA_SIZE\t65536\n"
"#define L1_DATA_LINESIZE\t32\n" "#define L1_DATA_LINESIZE\t32\n"
@ -108,7 +113,7 @@ if (DEFINED CORE AND CMAKE_CROSSCOMPILING AND NOT (${HOST_OS} STREQUAL "WINDOWSS
set(SGEMM_UNROLL_N 4) set(SGEMM_UNROLL_N 4)
set(DGEMM_UNROLL_M 4) set(DGEMM_UNROLL_M 4)
set(DGEMM_UNROLL_N 4) set(DGEMM_UNROLL_N 4)
elseif ("${CORE}" STREQUAL "ARMV8") elseif ("${TCORE}" STREQUAL "ARMV8")
file(APPEND ${TARGET_CONF_TEMP} file(APPEND ${TARGET_CONF_TEMP}
"#define L1_DATA_SIZE\t32768\n" "#define L1_DATA_SIZE\t32768\n"
"#define L1_DATA_LINESIZE\t64\n" "#define L1_DATA_LINESIZE\t64\n"
@ -118,9 +123,16 @@ if (DEFINED CORE AND CMAKE_CROSSCOMPILING AND NOT (${HOST_OS} STREQUAL "WINDOWSS
"#define DTB_SIZE\t4096\n" "#define DTB_SIZE\t4096\n"
"#define L2_ASSOCIATIVE\t32\n" "#define L2_ASSOCIATIVE\t32\n"
"#define ARMV8\n") "#define ARMV8\n")
set(SGEMM_UNROLL_M 4) set(SGEMM_UNROLL_M 16)
set(SGEMM_UNROLL_N 4) set(SGEMM_UNROLL_N 4)
elseif ("${CORE}" STREQUAL "CORTEXA57" OR "${CORE}" STREQUAL "CORTEXA53") set(DGEMM_UNROLL_M 8)
set(DGEMM_UNROLL_N 4)
set(CGEMM_UNROLL_M 8)
set(CGEMM_UNROLL_N 4)
set(ZGEMM_UNROLL_M 4)
set(ZGEMM_UNROLL_N 4)
set(SYMV_P 16)
elseif ("${TCORE}" STREQUAL "CORTEXA57" OR "${TCORE}" STREQUAL "CORTEXA53")
file(APPEND ${TARGET_CONF_TEMP} file(APPEND ${TARGET_CONF_TEMP}
"#define L1_CODE_SIZE\t32768\n" "#define L1_CODE_SIZE\t32768\n"
"#define L1_CODE_LINESIZE\t64\n" "#define L1_CODE_LINESIZE\t64\n"
@ -144,9 +156,10 @@ if (DEFINED CORE AND CMAKE_CROSSCOMPILING AND NOT (${HOST_OS} STREQUAL "WINDOWSS
set(DGEMM_UNROLL_N 4) set(DGEMM_UNROLL_N 4)
set(CGEMM_UNROLL_M 8) set(CGEMM_UNROLL_M 8)
set(CGEMM_UNROLL_N 4) set(CGEMM_UNROLL_N 4)
set(ZGEMM_UNROLL_M 8) set(ZGEMM_UNROLL_M 4)
set(ZGEMM_UNROLL_N 4) set(ZGEMM_UNROLL_N 4)
elseif ("${CORE}" STREQUAL "CORTEXA72" OR "${CORE}" STREQUAL "CORTEXA73") set(SYMV_P 16)
elseif ("${TCORE}" STREQUAL "CORTEXA72" OR "${TCORE}" STREQUAL "CORTEXA73")
file(APPEND ${TARGET_CONF_TEMP} file(APPEND ${TARGET_CONF_TEMP}
"#define L1_CODE_SIZE\t49152\n" "#define L1_CODE_SIZE\t49152\n"
"#define L1_CODE_LINESIZE\t64\n" "#define L1_CODE_LINESIZE\t64\n"
@ -170,9 +183,10 @@ if (DEFINED CORE AND CMAKE_CROSSCOMPILING AND NOT (${HOST_OS} STREQUAL "WINDOWSS
set(DGEMM_UNROLL_N 4) set(DGEMM_UNROLL_N 4)
set(CGEMM_UNROLL_M 8) set(CGEMM_UNROLL_M 8)
set(CGEMM_UNROLL_N 4) set(CGEMM_UNROLL_N 4)
set(ZGEMM_UNROLL_M 8) set(ZGEMM_UNROLL_M 4)
set(ZGEMM_UNROLL_N 4) set(ZGEMM_UNROLL_N 4)
elseif ("${CORE}" STREQUAL "FALKOR") set(SYMV_P 16)
elseif ("${TCORE}" STREQUAL "FALKOR")
file(APPEND ${TARGET_CONF_TEMP} file(APPEND ${TARGET_CONF_TEMP}
"#define L1_CODE_SIZE\t65536\n" "#define L1_CODE_SIZE\t65536\n"
"#define L1_CODE_LINESIZE\t64\n" "#define L1_CODE_LINESIZE\t64\n"
@ -196,9 +210,10 @@ if (DEFINED CORE AND CMAKE_CROSSCOMPILING AND NOT (${HOST_OS} STREQUAL "WINDOWSS
set(DGEMM_UNROLL_N 4) set(DGEMM_UNROLL_N 4)
set(CGEMM_UNROLL_M 8) set(CGEMM_UNROLL_M 8)
set(CGEMM_UNROLL_N 4) set(CGEMM_UNROLL_N 4)
set(ZGEMM_UNROLL_M 8) set(ZGEMM_UNROLL_M 4)
set(ZGEMM_UNROLL_N 4) set(ZGEMM_UNROLL_N 4)
elseif ("${CORE}" STREQUAL "THUNDERX") set(SYMV_P 16)
elseif ("${TCORE}" STREQUAL "THUNDERX")
file(APPEND ${TARGET_CONF_TEMP} file(APPEND ${TARGET_CONF_TEMP}
"#define L1_CODE_SIZE\t32768\n" "#define L1_CODE_SIZE\t32768\n"
"#define L1_CODE_LINESIZE\t64\n" "#define L1_CODE_LINESIZE\t64\n"
@ -224,7 +239,8 @@ if (DEFINED CORE AND CMAKE_CROSSCOMPILING AND NOT (${HOST_OS} STREQUAL "WINDOWSS
set(CGEMM_UNROLL_N 2) set(CGEMM_UNROLL_N 2)
set(ZGEMM_UNROLL_M 2) set(ZGEMM_UNROLL_M 2)
set(ZGEMM_UNROLL_N 2) set(ZGEMM_UNROLL_N 2)
elseif ("${CORE}" STREQUAL "THUNDERX2T99") set(SYMV_P 16)
elseif ("${TCORE}" STREQUAL "THUNDERX2T99")
file(APPEND ${TARGET_CONF_TEMP} file(APPEND ${TARGET_CONF_TEMP}
"#define L1_CODE_SIZE\t32768\n" "#define L1_CODE_SIZE\t32768\n"
"#define L1_CODE_LINESIZE\t64\n" "#define L1_CODE_LINESIZE\t64\n"
@ -240,7 +256,7 @@ if (DEFINED CORE AND CMAKE_CROSSCOMPILING AND NOT (${HOST_OS} STREQUAL "WINDOWSS
"#define L3_ASSOCIATIVE\t32\n" "#define L3_ASSOCIATIVE\t32\n"
"#define DTB_DEFAULT_ENTRIES\t64\n" "#define DTB_DEFAULT_ENTRIES\t64\n"
"#define DTB_SIZE\t4096\n" "#define DTB_SIZE\t4096\n"
"#define VULCAN\n") "#define ARMV8\n")
set(SGEMM_UNROLL_M 16) set(SGEMM_UNROLL_M 16)
set(SGEMM_UNROLL_N 4) set(SGEMM_UNROLL_N 4)
set(DGEMM_UNROLL_M 8) set(DGEMM_UNROLL_M 8)
@ -249,6 +265,7 @@ if (DEFINED CORE AND CMAKE_CROSSCOMPILING AND NOT (${HOST_OS} STREQUAL "WINDOWSS
set(CGEMM_UNROLL_N 4) set(CGEMM_UNROLL_N 4)
set(ZGEMM_UNROLL_M 4) set(ZGEMM_UNROLL_M 4)
set(ZGEMM_UNROLL_N 4) set(ZGEMM_UNROLL_N 4)
set(SYMV_P 16)
endif() endif()
# Or should this actually be NUM_CORES? # Or should this actually be NUM_CORES?