From f40819476c1b3de0a5d53b26cec8e444d1b417fe Mon Sep 17 00:00:00 2001 From: Martin Kroeker Date: Sat, 3 Aug 2024 23:54:35 +0200 Subject: [PATCH 1/3] mention RISCV64 as a permitted architecture for DYNAMIC_ARCH --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) From e8bd97ab4bf4c1faff0bd55404b22dad4a766e36 Mon Sep 17 00:00:00 2001 From: Martin Kroeker Date: Sat, 3 Aug 2024 23:56:59 +0200 Subject: [PATCH 2/3] add RISCV64 entries for DYNAMIC_ARCH --- cmake/arch.cmake | 6 +++++- cmake/system.cmake | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) 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") From 2aed90171ab0db59f7d3ee4fa675136aca09e6e3 Mon Sep 17 00:00:00 2001 From: Martin Kroeker Date: Sat, 3 Aug 2024 23:58:10 +0200 Subject: [PATCH 3/3] Add riscv sources for DYNAMIC_ARCH --- driver/others/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) 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 ()