Skip to content

Commit 4ae8707

Browse files
authored
Merge pull request #5389 from martin-frbg/issue5388
Add cross-compilation parameters for RISCV64 targets in CMake
2 parents d92f151 + b24212f commit 4ae8707

File tree

1 file changed

+73
-1
lines changed

1 file changed

+73
-1
lines changed

cmake/prebuild.cmake

Lines changed: 73 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1407,6 +1407,78 @@ endif ()
14071407
set(ZGEMM_UNROLL_M 8)
14081408
set(ZGEMM_UNROLL_N 2)
14091409
set(SYMV_P 8)
1410+
elseif ("${TCORE}" STREQUAL "C910V")
1411+
file(APPEND ${TARGET_CONF_TEMP}
1412+
"#define L1_DATA_SIZE 32768\n"
1413+
"#define L1_DATA_LINESIZE 32\n"
1414+
"#define L2_SIZE 1048576\n"
1415+
"#define L2_LINESIZE 32 \n"
1416+
"#define DTB_DEFAULT_ENTRIES 128\n"
1417+
"#define DTB_SIZE 4096\n"
1418+
"#define L2_ASSOCIATIVE 4\n")
1419+
set(SGEMM_UNROLL_M 16)
1420+
set(SGEMM_UNROLL_N 4)
1421+
set(DGEMM_UNROLL_M 8)
1422+
set(DGEMM_UNROLL_N 4)
1423+
set(CGEMM_UNROLL_M 2)
1424+
set(CGEMM_UNROLL_N 2)
1425+
set(ZGEMM_UNROLL_M 2)
1426+
set(ZGEMM_UNROLL_N 2)
1427+
set(SYMV_P 16)
1428+
elseif ("${TCORE}" STREQUAL "x280")
1429+
file(APPEND ${TARGET_CONF_TEMP}
1430+
"#define L1_DATA_SIZE 65536\n"
1431+
"#define L1_LINESIZE 32 \n"
1432+
"#define L2_SIZE 262144\n"
1433+
"#define L2_LINESIZE 32 \n"
1434+
"#define DTB_DEFAULT_ENTRIES 128\n"
1435+
"#define DTB_SIZE 4096\n"
1436+
"#define L2_ASSOCIATIVE 4\n")
1437+
set(SGEMM_UNROLL_M 16)
1438+
set(SGEMM_UNROLL_N 8)
1439+
set(DGEMM_UNROLL_M 16)
1440+
set(DGEMM_UNROLL_N 8)
1441+
set(CGEMM_UNROLL_M 8)
1442+
set(CGEMM_UNROLL_N 4)
1443+
set(ZGEMM_UNROLL_M 8)
1444+
set(ZGEMM_UNROLL_N 4)
1445+
set(SYMV_P 16)
1446+
elseif ("${TCORE}" STREQUAL "RISCV64_ZVL128B")
1447+
file(APPEND ${TARGET_CONF_TEMP}
1448+
"#define L1_DATA_SIZE 32768\n"
1449+
"#define L1_DATA_LINESIZE 32\n"
1450+
"#define L2_SIZE 1048576\n"
1451+
"#define L2_LINESIZE 32 \n"
1452+
"#define DTB_DEFAULT_ENTRIES 128\n"
1453+
"#define DTB_SIZE 4096\n"
1454+
"#define L2_ASSOCIATIVE 4\n")
1455+
set(SGEMM_UNROLL_M 8)
1456+
set(SGEMM_UNROLL_N 8)
1457+
set(DGEMM_UNROLL_M 8)
1458+
set(DGEMM_UNROLL_N 4)
1459+
set(CGEMM_UNROLL_M 8)
1460+
set(CGEMM_UNROLL_N 4)
1461+
set(ZGEMM_UNROLL_M 4)
1462+
set(ZGEMM_UNROLL_N 4)
1463+
set(SYMV_P 16)
1464+
elseif ("${TCORE}" STREQUAL "RISCV64_ZVL256B")
1465+
file(APPEND ${TARGET_CONF_TEMP}
1466+
"#define L1_DATA_SIZE 65536\n"
1467+
"#define L1_DATA_LINESIZE 32\n"
1468+
"#define L2_SIZE 262144\n"
1469+
"#define L2_LINESIZE 32 \n"
1470+
"#define DTB_DEFAULT_ENTRIES 128\n"
1471+
"#define DTB_SIZE 4096\n"
1472+
"#define L2_ASSOCIATIVE 4\n")
1473+
set(SGEMM_UNROLL_M 16)
1474+
set(SGEMM_UNROLL_N 8)
1475+
set(DGEMM_UNROLL_M 8)
1476+
set(DGEMM_UNROLL_N 8)
1477+
set(CGEMM_UNROLL_M 8)
1478+
set(CGEMM_UNROLL_N 8)
1479+
set(ZGEMM_UNROLL_M 8)
1480+
set(ZGEMM_UNROLL_N 4)
1481+
set(SYMV_P 16)
14101482
elseif ("${TCORE}" STREQUAL "GENERIC")
14111483
file(APPEND ${TARGET_CONF_TEMP}
14121484
"#define L1_DATA_SIZE 32768\n"
@@ -1418,7 +1490,7 @@ endif ()
14181490
"#define L2_ASSOCIATIVE 8\n")
14191491
elseif ("${TCORE}" STREQUAL "RISCV64_GENERIC")
14201492
file(APPEND ${TARGET_CONF_TEMP}
1421-
"#define L1_DATA_SIZE 32768\n"
1493+
"#define L1_DATA_SIZE 32768\n"
14221494
"#define L1_DATA_LINESIZE 32\n"
14231495
"#define L2_SIZE 1048576\n"
14241496
"#define L2_LINESIZE 32 \n"

0 commit comments

Comments
 (0)