Skip to content

Commit

Permalink
fix missing asimdfhm target macro in ndk-r21
Browse files Browse the repository at this point in the history
  • Loading branch information
nihui committed Nov 28, 2024
1 parent 1172b04 commit 2dc3106
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cmake/ncnn_add_layer.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,8 @@ macro(ncnn_add_layer class)
ncnn_add_arch_opt_source(${class} asimddp "-march=armv8.2-a+fp16+dotprod")
endif()
if(NCNN_RUNTIME_CPU AND NCNN_ARM82FP16FML)
ncnn_add_arch_opt_source(${class} asimdfhm "-march=armv8.2-a+fp16+fp16fml")
# clang 9.0.9 shipped with android ndk-r21 is missing __ARM_FEATURE_FP16_FML macro for asimdfhm target
ncnn_add_arch_opt_source(${class} asimdfhm "-march=armv8.2-a+fp16+fp16fml -D__ARM_FEATURE_FP16_FML")
endif()
if(NCNN_RUNTIME_CPU AND NCNN_ARM84BF16)
ncnn_add_arch_opt_source(${class} bf16 "-march=armv8.4-a+fp16+dotprod+bf16")
Expand Down
2 changes: 2 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -634,6 +634,8 @@ if(NCNN_TARGET_ARCH STREQUAL "arm" AND (CMAKE_SIZEOF_VOID_P EQUAL 8 OR NCNN_TARG
endif()
if(NCNN_ARM82FP16FML)
set(ARM_MARCH_FLAG "${ARM_MARCH_FLAG}+fp16fml")
# clang 9.0.9 shipped with android ndk-r21 is missing __ARM_FEATURE_FP16_FML macro for asimdfhm target
target_compile_options(ncnn PRIVATE -D__ARM_FEATURE_FP16_FML)
endif()
endif()
endif()
Expand Down

0 comments on commit 2dc3106

Please sign in to comment.