Fix RVV toolchain conflicts.
authorHAN Liutong <liutong2020@iscas.ac.cn>
Sun, 30 May 2021 08:00:18 +0000 (16:00 +0800)
committerHAN Liutong <liutong2020@iscas.ac.cn>
Sun, 30 May 2021 08:00:18 +0000 (16:00 +0800)
modules/core/include/opencv2/core/cv_cpu_dispatch.h
platforms/linux/riscv64-071-gcc.toolchain.cmake

index f3437b5..8365b10 100644 (file)
 #  define CV_NEON 1
 #endif
 
-#if defined(__riscv) && defined(__riscv_vector)
+#if defined(__riscv) && defined(__riscv_vector) && defined(__riscv_vector_071)
 # include<riscv-vector.h>
 # define CV_RVV071 1
 #endif
index 934680f..be2c7dc 100644 (file)
@@ -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")