From 8bd540522821a4046154743bbed47b1fa6e83fa1 Mon Sep 17 00:00:00 2001 From: HAN Liutong Date: Sun, 30 May 2021 16:00:18 +0800 Subject: [PATCH] Fix RVV toolchain conflicts. --- modules/core/include/opencv2/core/cv_cpu_dispatch.h | 2 +- platforms/linux/riscv64-071-gcc.toolchain.cmake | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/core/include/opencv2/core/cv_cpu_dispatch.h b/modules/core/include/opencv2/core/cv_cpu_dispatch.h index f3437b5..8365b10 100644 --- a/modules/core/include/opencv2/core/cv_cpu_dispatch.h +++ b/modules/core/include/opencv2/core/cv_cpu_dispatch.h @@ -142,7 +142,7 @@ # define CV_NEON 1 #endif -#if defined(__riscv) && defined(__riscv_vector) +#if defined(__riscv) && defined(__riscv_vector) && defined(__riscv_vector_071) # include # define CV_RVV071 1 #endif diff --git a/platforms/linux/riscv64-071-gcc.toolchain.cmake b/platforms/linux/riscv64-071-gcc.toolchain.cmake index 934680f..be2c7dc 100644 --- a/platforms/linux/riscv64-071-gcc.toolchain.cmake +++ b/platforms/linux/riscv64-071-gcc.toolchain.cmake @@ -5,5 +5,5 @@ set(CMAKE_CXX_COMPILER riscv64-unknown-linux-gnu-g++) set(CMAKE_CXX_FLAGS "" CACHE STRING "") set(CMAKE_C_FLAGS "" CACHE STRING "") -set(CMAKE_CXX_FLAGS "-static -march=rv64gcvxthead -mabi=lp64v -pthread") -set(CMAKE_C_FLAGS "-static -march=rv64gcvxthead -mabi=lp64v -pthread") +set(CMAKE_CXX_FLAGS "-static -march=rv64gcvxthead -mabi=lp64v -pthread -D__riscv_vector_071") +set(CMAKE_C_FLAGS "-static -march=rv64gcvxthead -mabi=lp64v -pthread -D__riscv_vector_071") -- 2.7.4