Skip to content

Commit ae27b02

Browse files
authored
Merge pull request #4837 from martin-frbg/dyn_riscv_cmake
Add CMAKE support for RISCV64 DYNAMIC_ARCH
2 parents 2c2b6bc + 2aed901 commit ae27b02

File tree

4 files changed

+10
-4
lines changed

4 files changed

+10
-4
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ option(C_LAPACK "Build LAPACK from C sources instead of the original Fortran" OF
3030

3131
option(BUILD_WITHOUT_CBLAS "Do not build the C interface (CBLAS) to the BLAS functions" OFF)
3232

33-
option(DYNAMIC_ARCH "Include support for multiple CPU targets, with automatic selection at runtime (x86/x86_64, aarch64 or ppc only)" OFF)
33+
option(DYNAMIC_ARCH "Include support for multiple CPU targets, with automatic selection at runtime (x86/x86_64, aarch64, ppc or RISCV64-RVV1.0 only)" OFF)
3434

3535
option(DYNAMIC_OLDER "Include specific support for older x86 cpu models (Penryn,Dunnington,Atom,Nano,Opteron) with DYNAMIC_ARCH" OFF)
3636

cmake/arch.cmake

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,11 @@ if (DYNAMIC_ARCH)
5757
set(DYNAMIC_CORE POWER6 POWER8 POWER9 POWER10)
5858
set(CCOMMON_OPT "${CCOMMON_OPT} -DHAVE_P10_SUPPORT")
5959
endif ()
60-
60+
61+
if (RISCV64)
62+
set(DYNAMIC_CORE RISCV64_GENERIC RISCV64_ZVL128B RISCV64_ZVL256B)
63+
endif ()
64+
6165
if (X86)
6266
set(DYNAMIC_CORE KATMAI COPPERMINE NORTHWOOD PRESCOTT BANIAS CORE2 PENRYN DUNNINGTON NEHALEM ATHLON OPTERON OPTERON_SSE3 BARCELONA BOBCAT ATOM NANO)
6367
endif ()

cmake/system.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ endif ()
391391
if (X86_64 OR ${CORE} STREQUAL POWER10)
392392
set(SMALL_MATRIX_OPT TRUE)
393393
endif ()
394-
if (ARM64 OR RISCV64 OR POWER)
394+
if (ARM64)
395395
set(GEMM_GEMV_FORWARD TRUE)
396396
endif ()
397397

@@ -403,7 +403,7 @@ if (SMALL_MATRIX_OPT)
403403
endif ()
404404

405405
if (DYNAMIC_ARCH)
406-
if (X86 OR X86_64 OR ARM64 OR POWER)
406+
if (X86 OR X86_64 OR ARM64 OR POWER OR RISCV64)
407407
set(CCOMMON_OPT "${CCOMMON_OPT} -DDYNAMIC_ARCH")
408408
if (DYNAMIC_OLDER)
409409
set(CCOMMON_OPT "${CCOMMON_OPT} -DDYNAMIC_OLDER")

driver/others/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ if (DYNAMIC_ARCH)
5252
list(APPEND COMMON_SOURCES dynamic_arm64.c)
5353
elseif (POWER)
5454
list(APPEND COMMON_SOURCES dynamic_power.c)
55+
elseif (RISCV64)
56+
list(APPEND COMMON_SOURCES dynamic_riscv64.c detect_riscv64.c)
5557
else ()
5658
list(APPEND COMMON_SOURCES dynamic.c)
5759
endif ()

0 commit comments

Comments
 (0)