From bcbb55f03374f4bf974e65d09b82829b912b0347 Mon Sep 17 00:00:00 2001 From: nihui Date: Mon, 31 May 2021 15:29:41 +0800 Subject: [PATCH] apple device always has armv8.2 dot (#2963) --- cmake/ncnn_add_layer.cmake | 2 +- src/layer.cpp | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cmake/ncnn_add_layer.cmake b/cmake/ncnn_add_layer.cmake index c681b6b5b..e1fa120a4 100644 --- a/cmake/ncnn_add_layer.cmake +++ b/cmake/ncnn_add_layer.cmake @@ -154,7 +154,7 @@ macro(ncnn_add_layer class) endif() endif() - if(NCNN_RUNTIME_CPU AND NCNN_ARM82 AND ((IOS AND CMAKE_OSX_ARCHITECTURES MATCHES "arm64") OR (APPLE AND CMAKE_OSX_ARCHITECTURES MATCHES "arm64") OR (CMAKE_SYSTEM_PROCESSOR MATCHES "^(arm64|aarch64)"))) + if(NCNN_RUNTIME_CPU AND NCNN_ARM82 AND (NOT IOS) AND (NOT APPLE) AND (CMAKE_SYSTEM_PROCESSOR MATCHES "^(arm64|aarch64)")) # enable armv8.2a+fp16 set(NCNN_ARM_HEADER ${CMAKE_CURRENT_SOURCE_DIR}/layer/${NCNN_TARGET_ARCH}/${name}_${NCNN_TARGET_ARCH}.h) set(NCNN_ARM_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/layer/${NCNN_TARGET_ARCH}/${name}_${NCNN_TARGET_ARCH}.cpp) diff --git a/src/layer.cpp b/src/layer.cpp index 7dfb241aa..3889cac24 100644 --- a/src/layer.cpp +++ b/src/layer.cpp @@ -208,11 +208,11 @@ static const layer_registry_entry layer_registry_avx2[] = { }; #endif // NCNN_RUNTIME_CPU && NCNN_AVX2 -#if NCNN_RUNTIME_CPU && NCNN_ARM82 +#if NCNN_RUNTIME_CPU && NCNN_ARM82 && !__APPLE__ static const layer_registry_entry layer_registry_arm82[] = { #include "layer_registry_arm82.h" }; -#endif // NCNN_RUNTIME_CPU && NCNN_ARM82 +#endif // NCNN_RUNTIME_CPU && NCNN_ARM82 && !__APPLE__ #if NCNN_RUNTIME_CPU && NCNN_ARM82DOT static const layer_registry_entry layer_registry_arm82dot[] = { @@ -272,13 +272,13 @@ Layer* create_layer(int index) } else #endif // NCNN_RUNTIME_CPU && NCNN_ARM82DOT -#if NCNN_RUNTIME_CPU && NCNN_ARM82 +#if NCNN_RUNTIME_CPU && NCNN_ARM82 && !__APPLE__ if (ncnn::cpu_support_arm_asimdhp()) { layer_creator = layer_registry_arm82[index].creator; } else -#endif // NCNN_RUNTIME_CPU && NCNN_ARM82 +#endif // NCNN_RUNTIME_CPU && NCNN_ARM82 && !__APPLE__ #if NCNN_RUNTIME_CPU && NCNN_RVV if (ncnn::cpu_support_riscv_v()) {