Browse Source

apple device always has armv8.2 dot (#2963)

tags/20210720
nihui GitHub 5 years ago
parent
commit
bcbb55f033
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions
  1. +1
    -1
      cmake/ncnn_add_layer.cmake
  2. +4
    -4
      src/layer.cpp

+ 1
- 1
cmake/ncnn_add_layer.cmake View File

@@ -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)


+ 4
- 4
src/layer.cpp View File

@@ -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())
{


Loading…
Cancel
Save