Skip to content

Commit

Permalink
ff
Browse files Browse the repository at this point in the history
  • Loading branch information
nihui committed Dec 3, 2024
1 parent 8f6f48f commit 69e69f2
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -669,13 +669,19 @@ endif()
if(NCNN_TARGET_ARCH STREQUAL "riscv" AND CMAKE_SIZEOF_VOID_P EQUAL 8 AND NOT C906)
if(NOT NCNN_RUNTIME_CPU AND NCNN_RVV)
set(RISCV_MARCH_FLAG "-march=rv64gcv")
if(NCNN_ZFH)
set(RISCV_MARCH_FLAG "${RISCV_MARCH_FLAG}_zfh")
target_compile_options(ncnn PRIVATE -D__fp16=_Float16)
endif()
if(NCNN_ZVFH)
set(RISCV_MARCH_FLAG "${RISCV_MARCH_FLAG}_zfh_zvfh")
set(RISCV_MARCH_FLAG "${RISCV_MARCH_FLAG}_zvfh")
endif()
elseif(NOT NCNN_RUNTIME_CPU AND NCNN_XTHEADVECTOR)
set(RISCV_MARCH_FLAG "-march=rv64gc_xtheadvector")
if(NCNN_ZFH)
set(RISCV_MARCH_FLAG "${RISCV_MARCH_FLAG}_zfh")
target_compile_options(ncnn PRIVATE -D__fp16=_Float16)
endif()
elseif(NOT NCNN_RUNTIME_CPU AND NCNN_ZVFH)
set(RISCV_MARCH_FLAG "-march=rv64gc_zfh_xtheadvector")
target_compile_options(ncnn PRIVATE -D__fp16=_Float16)
endif()
target_compile_options(ncnn PRIVATE ${RISCV_MARCH_FLAG})
endif()
Expand Down

0 comments on commit 69e69f2

Please sign in to comment.