diff --git a/CMakeLists.txt b/CMakeLists.txt index 07a3457cc..75e6b27f3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -30,7 +30,7 @@ option(C_LAPACK "Build LAPACK from C sources instead of the original Fortran" OF option(BUILD_WITHOUT_CBLAS "Do not build the C interface (CBLAS) to the BLAS functions" OFF) -option(DYNAMIC_ARCH "Include support for multiple CPU targets, with automatic selection at runtime (x86/x86_64, aarch64 or ppc only)" OFF) +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) option(DYNAMIC_OLDER "Include specific support for older x86 cpu models (Penryn,Dunnington,Atom,Nano,Opteron) with DYNAMIC_ARCH" OFF) diff --git a/cmake/arch.cmake b/cmake/arch.cmake index 27c5650ab..5f3703ae0 100644 --- a/cmake/arch.cmake +++ b/cmake/arch.cmake @@ -57,7 +57,11 @@ if (DYNAMIC_ARCH) set(DYNAMIC_CORE POWER6 POWER8 POWER9 POWER10) set(CCOMMON_OPT "${CCOMMON_OPT} -DHAVE_P10_SUPPORT") endif () - + + if (RISCV64) + set(DYNAMIC_CORE RISCV64_GENERIC RISCV64_ZVL128B RISCV64_ZVL256B) + endif () + if (X86) set(DYNAMIC_CORE KATMAI COPPERMINE NORTHWOOD PRESCOTT BANIAS CORE2 PENRYN DUNNINGTON NEHALEM ATHLON OPTERON OPTERON_SSE3 BARCELONA BOBCAT ATOM NANO) endif () diff --git a/cmake/system.cmake b/cmake/system.cmake index a3f7fd173..031e876ab 100644 --- a/cmake/system.cmake +++ b/cmake/system.cmake @@ -391,7 +391,7 @@ endif () if (X86_64 OR ${CORE} STREQUAL POWER10) set(SMALL_MATRIX_OPT TRUE) endif () -if (ARM64 OR RISCV64 OR POWER) +if (ARM64) set(GEMM_GEMV_FORWARD TRUE) endif () @@ -403,7 +403,7 @@ if (SMALL_MATRIX_OPT) endif () if (DYNAMIC_ARCH) - if (X86 OR X86_64 OR ARM64 OR POWER) + if (X86 OR X86_64 OR ARM64 OR POWER OR RISCV64) set(CCOMMON_OPT "${CCOMMON_OPT} -DDYNAMIC_ARCH") if (DYNAMIC_OLDER) set(CCOMMON_OPT "${CCOMMON_OPT} -DDYNAMIC_OLDER") diff --git a/driver/others/CMakeLists.txt b/driver/others/CMakeLists.txt index 192bf2d8f..659449fbc 100644 --- a/driver/others/CMakeLists.txt +++ b/driver/others/CMakeLists.txt @@ -52,6 +52,8 @@ if (DYNAMIC_ARCH) list(APPEND COMMON_SOURCES dynamic_arm64.c) elseif (POWER) list(APPEND COMMON_SOURCES dynamic_power.c) + elseif (RISCV64) + list(APPEND COMMON_SOURCES dynamic_riscv64.c detect_riscv64.c) else () list(APPEND COMMON_SOURCES dynamic.c) endif ()