From 73c64de10ec0ddec9adcd969dc84c83ba18f654e Mon Sep 17 00:00:00 2001 From: Jim-Wang Date: Tue, 2 Jan 2024 06:54:05 +0000 Subject: [PATCH 1/6] update to 20240102 --- ports/ncnn/portfile.cmake | 2 +- ports/ncnn/vcpkg.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/ncnn/portfile.cmake b/ports/ncnn/portfile.cmake index f8e846e23f2130..e1131eb8dba019 100644 --- a/ports/ncnn/portfile.cmake +++ b/ports/ncnn/portfile.cmake @@ -2,7 +2,7 @@ vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO Tencent/ncnn REF "${VERSION}" - SHA512 722966b3b30c5a4df81c6d45237b1821acc69db0c78350a41e3bc60e3f40c3dc64587ae0ab223635c468314c665e477ee7e0c2d3d4cccbc72bb15aeb56dcda6c + SHA512 31bc3c2f461a00241fb8f69ca6ea8cc590af6618856b1b84a048bde924e4b474fd883ad5d54dbfbdd1e5b59015889e15ffc4fbafccb3e42e052a02071f2017b1 HEAD_REF master ) diff --git a/ports/ncnn/vcpkg.json b/ports/ncnn/vcpkg.json index fbf005e68ae177..28be929f74ac3d 100644 --- a/ports/ncnn/vcpkg.json +++ b/ports/ncnn/vcpkg.json @@ -1,6 +1,6 @@ { "name": "ncnn", - "version": "20231027", + "version": "20240102", "description": "ncnn is a high-performance neural network inference computing framework.", "homepage": "https://github.com/Tencent/ncnn", "license": "BSD-3-Clause", From 59f9afa3e70d499b453932184c26f7fa3529168d Mon Sep 17 00:00:00 2001 From: Jim-Wang Date: Tue, 2 Jan 2024 06:54:38 +0000 Subject: [PATCH 2/6] update version --- versions/baseline.json | 2 +- versions/n-/ncnn.json | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/versions/baseline.json b/versions/baseline.json index d20ea4f53b468d..090c416f9120bd 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -5905,7 +5905,7 @@ "port-version": 2 }, "ncnn": { - "baseline": "20231027", + "baseline": "20240102", "port-version": 0 }, "ncurses": { diff --git a/versions/n-/ncnn.json b/versions/n-/ncnn.json index 348ed94bf90426..4e2dbaa41aa098 100644 --- a/versions/n-/ncnn.json +++ b/versions/n-/ncnn.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "112ccb4bd8c5955537ac5e93bb2e2ed3c14cfa10", + "version": "20240102", + "port-version": 0 + }, { "git-tree": "2a6a2a9cc4c71cac799469f587478b987a63e0ed", "version": "20231027", From f32c6c76310f1e0c886e2f94176d2261c775feab Mon Sep 17 00:00:00 2001 From: Jim-Wang Date: Fri, 2 Feb 2024 09:01:35 +0000 Subject: [PATCH 3/6] fix uwp --- ports/ncnn/fix_uwp.patch | 42 +++++++++++++++++++++++++++++++++++++++ ports/ncnn/portfile.cmake | 2 ++ 2 files changed, 44 insertions(+) create mode 100644 ports/ncnn/fix_uwp.patch diff --git a/ports/ncnn/fix_uwp.patch b/ports/ncnn/fix_uwp.patch new file mode 100644 index 00000000000000..d678464aeaa3dc --- /dev/null +++ b/ports/ncnn/fix_uwp.patch @@ -0,0 +1,42 @@ +diff --git a/src/cpu.cpp b/src/cpu.cpp +index e56cd67..3ca1189 100644 +--- a/src/cpu.cpp ++++ b/src/cpu.cpp +@@ -184,6 +184,13 @@ static int g_cpu_is_arm_a53_a55; + #endif // defined __ANDROID__ || defined __linux__ + + #if defined _WIN32 ++#if WINAPI_FAMILY == WINAPI_FAMILY_APP ++static int detectisa(const void* /*some_inst*/) ++{ ++ // uwp does not support seh :( ++ return 0; ++} ++#else // WINAPI_FAMILY == WINAPI_FAMILY_APP + static int g_sigill_caught = 0; + static jmp_buf g_jmpbuf; + +@@ -213,6 +220,7 @@ static int detectisa(const void* some_inst) + + return g_sigill_caught ? 0 : 1; + } ++#endif // WINAPI_FAMILY == WINAPI_FAMILY_APP + + #if defined(__i386__) || defined(__x86_64__) || defined(_M_IX86) || defined(_M_X64) + #ifdef _MSC_VER +@@ -1966,12 +1974,12 @@ static void initialize_global_cpu_info() + + #if defined _WIN32 + #if __arm__ +- g_cpu_support_arm_neon = detectisa(some_neon); ++ g_cpu_support_arm_neon = 1; // all modern windows arm devices have neon + g_cpu_support_arm_vfpv4 = detectisa(some_vfpv4); + #if __aarch64__ + g_cpu_support_arm_cpuid = detectisa(some_cpuid); +- g_cpu_support_arm_asimdhp = detectisa(some_asimdhp); +- g_cpu_support_arm_asimddp = detectisa(some_asimddp); ++ g_cpu_support_arm_asimdhp = detectisa(some_asimdhp) || IsProcessorFeaturePresent(43); // dp implies hp ++ g_cpu_support_arm_asimddp = detectisa(some_asimddp) || IsProcessorFeaturePresent(43); // 43 is PF_ARM_V82_DP_INSTRUCTIONS_AVAILABLE + g_cpu_support_arm_asimdfhm = detectisa(some_asimdfhm); + g_cpu_support_arm_bf16 = detectisa(some_bf16); + g_cpu_support_arm_i8mm = detectisa(some_i8mm); diff --git a/ports/ncnn/portfile.cmake b/ports/ncnn/portfile.cmake index e1131eb8dba019..599391bf909c43 100644 --- a/ports/ncnn/portfile.cmake +++ b/ports/ncnn/portfile.cmake @@ -4,6 +4,8 @@ vcpkg_from_github( REF "${VERSION}" SHA512 31bc3c2f461a00241fb8f69ca6ea8cc590af6618856b1b84a048bde924e4b474fd883ad5d54dbfbdd1e5b59015889e15ffc4fbafccb3e42e052a02071f2017b1 HEAD_REF master + PATCHES + fix_uwp.patch ) string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" BUILD_SHARED) From 189081b6a4e42acd9332f93515c00286b447163b Mon Sep 17 00:00:00 2001 From: Jim-Wang Date: Fri, 2 Feb 2024 09:02:02 +0000 Subject: [PATCH 4/6] update version --- versions/n-/ncnn.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versions/n-/ncnn.json b/versions/n-/ncnn.json index 4e2dbaa41aa098..bbbd68c03acb1d 100644 --- a/versions/n-/ncnn.json +++ b/versions/n-/ncnn.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "112ccb4bd8c5955537ac5e93bb2e2ed3c14cfa10", + "git-tree": "3377d50d30cb8cf7a2ae134afcde9cbc65144a2d", "version": "20240102", "port-version": 0 }, From 2384c3120d44b9f666f19025df206688c92361ef Mon Sep 17 00:00:00 2001 From: Jim-Wang Date: Fri, 2 Feb 2024 09:02:43 +0000 Subject: [PATCH 5/6] fix uwp --- ports/ncnn/portfile.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/ncnn/portfile.cmake b/ports/ncnn/portfile.cmake index 599391bf909c43..a3dec468a362ed 100644 --- a/ports/ncnn/portfile.cmake +++ b/ports/ncnn/portfile.cmake @@ -5,7 +5,7 @@ vcpkg_from_github( SHA512 31bc3c2f461a00241fb8f69ca6ea8cc590af6618856b1b84a048bde924e4b474fd883ad5d54dbfbdd1e5b59015889e15ffc4fbafccb3e42e052a02071f2017b1 HEAD_REF master PATCHES - fix_uwp.patch + fix_uwp.patch #https://github.com/Tencent/ncnn/pull/5328 ) string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" BUILD_SHARED) From 28504d6a39ec8511a1ed3365c06397b2fca7693a Mon Sep 17 00:00:00 2001 From: Jim-Wang Date: Fri, 2 Feb 2024 09:02:53 +0000 Subject: [PATCH 6/6] update version --- versions/n-/ncnn.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versions/n-/ncnn.json b/versions/n-/ncnn.json index bbbd68c03acb1d..60b0168727164b 100644 --- a/versions/n-/ncnn.json +++ b/versions/n-/ncnn.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "3377d50d30cb8cf7a2ae134afcde9cbc65144a2d", + "git-tree": "322a0f4cfc94f9d73060a9636854a8e1260796fd", "version": "20240102", "port-version": 0 },