Merge pull request #4837 from martin-frbg/dyn_riscv_cmake
Add CMAKE support for RISCV64 DYNAMIC_ARCH
This commit is contained in:
commit
ae27b02213
|
@ -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(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)
|
option(DYNAMIC_OLDER "Include specific support for older x86 cpu models (Penryn,Dunnington,Atom,Nano,Opteron) with DYNAMIC_ARCH" OFF)
|
||||||
|
|
||||||
|
|
|
@ -57,7 +57,11 @@ if (DYNAMIC_ARCH)
|
||||||
set(DYNAMIC_CORE POWER6 POWER8 POWER9 POWER10)
|
set(DYNAMIC_CORE POWER6 POWER8 POWER9 POWER10)
|
||||||
set(CCOMMON_OPT "${CCOMMON_OPT} -DHAVE_P10_SUPPORT")
|
set(CCOMMON_OPT "${CCOMMON_OPT} -DHAVE_P10_SUPPORT")
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
|
if (RISCV64)
|
||||||
|
set(DYNAMIC_CORE RISCV64_GENERIC RISCV64_ZVL128B RISCV64_ZVL256B)
|
||||||
|
endif ()
|
||||||
|
|
||||||
if (X86)
|
if (X86)
|
||||||
set(DYNAMIC_CORE KATMAI COPPERMINE NORTHWOOD PRESCOTT BANIAS CORE2 PENRYN DUNNINGTON NEHALEM ATHLON OPTERON OPTERON_SSE3 BARCELONA BOBCAT ATOM NANO)
|
set(DYNAMIC_CORE KATMAI COPPERMINE NORTHWOOD PRESCOTT BANIAS CORE2 PENRYN DUNNINGTON NEHALEM ATHLON OPTERON OPTERON_SSE3 BARCELONA BOBCAT ATOM NANO)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
|
@ -391,7 +391,7 @@ endif ()
|
||||||
if (X86_64 OR ${CORE} STREQUAL POWER10)
|
if (X86_64 OR ${CORE} STREQUAL POWER10)
|
||||||
set(SMALL_MATRIX_OPT TRUE)
|
set(SMALL_MATRIX_OPT TRUE)
|
||||||
endif ()
|
endif ()
|
||||||
if (ARM64 OR RISCV64 OR POWER)
|
if (ARM64)
|
||||||
set(GEMM_GEMV_FORWARD TRUE)
|
set(GEMM_GEMV_FORWARD TRUE)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
|
@ -403,7 +403,7 @@ if (SMALL_MATRIX_OPT)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
if (DYNAMIC_ARCH)
|
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")
|
set(CCOMMON_OPT "${CCOMMON_OPT} -DDYNAMIC_ARCH")
|
||||||
if (DYNAMIC_OLDER)
|
if (DYNAMIC_OLDER)
|
||||||
set(CCOMMON_OPT "${CCOMMON_OPT} -DDYNAMIC_OLDER")
|
set(CCOMMON_OPT "${CCOMMON_OPT} -DDYNAMIC_OLDER")
|
||||||
|
|
|
@ -52,6 +52,8 @@ if (DYNAMIC_ARCH)
|
||||||
list(APPEND COMMON_SOURCES dynamic_arm64.c)
|
list(APPEND COMMON_SOURCES dynamic_arm64.c)
|
||||||
elseif (POWER)
|
elseif (POWER)
|
||||||
list(APPEND COMMON_SOURCES dynamic_power.c)
|
list(APPEND COMMON_SOURCES dynamic_power.c)
|
||||||
|
elseif (RISCV64)
|
||||||
|
list(APPEND COMMON_SOURCES dynamic_riscv64.c detect_riscv64.c)
|
||||||
else ()
|
else ()
|
||||||
list(APPEND COMMON_SOURCES dynamic.c)
|
list(APPEND COMMON_SOURCES dynamic.c)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
Loading…
Reference in New Issue