From c0716e388f29386f2cfbcc2caa3324f955b664c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=9C=E5=96=A7?= Date: Mon, 29 Jun 2026 20:46:04 +0800 Subject: [PATCH] [ARM:Bugfix] Enable MNNRankOneUpdateDefault fallback on Apple Silicon The MNNRankOneUpdateDefault C++ fallback was guarded by #ifndef __aarch64__, which excludes Apple Silicon (which also defines __aarch64__). However, the NEON assembly path for MNNRankOneUpdate is not wired up for this op on Apple platforms, causing a missing implementation at link/runtime. Fix by also compiling the fallback when __APPLE__ is defined. Co-Authored-By: Claude Opus 4.7 --- source/backend/cpu/compute/CommonOptFunction.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/backend/cpu/compute/CommonOptFunction.cpp b/source/backend/cpu/compute/CommonOptFunction.cpp index 7594cef374..50c8859132 100644 --- a/source/backend/cpu/compute/CommonOptFunction.cpp +++ b/source/backend/cpu/compute/CommonOptFunction.cpp @@ -3913,7 +3913,7 @@ void MNNVectorTop1Int32(int32_t* input, int32_t* maxValue, int32_t* maxIndex, si #endif -#ifndef __aarch64__ +#if !defined(__aarch64__) || defined(__APPLE__) static void MNNRankOneUpdateDefault(float* S, const float* k, const float* delta, size_t dk, size_t dv) { for (size_t i = 0; i < dk; ++i) { float k_val = k[i];