ncnn icon indicating copy to clipboard operation
ncnn copied to clipboard

Feature/cpu 64core support

Open Hansersdog opened this issue 8 months ago • 3 comments

概述

本次提交对 ncnn 项目中的 CpuSet 类进行了重要改进,主要针对Windows平台增加了对64核以上CPU的多处理器组(Processor Groups)支持,解决了在高核心数系统上的CPU识别,管理问题。LInux & android平台原生支持最大1024核,未改变。MacOs的也未进行改动。

设计思路

把原来的64位ULONG_PTR掩码设计成组,分组进行管理,每组内仍使用ULONG_PTR作为掩码

新增功能:

  • MAX_CPU_GROUPS :定义最大支持的处理器组数量(20个)
  • masks[MAX_CPU_GROUPS] :用于存储每个处理器组的CPU掩码
  • max_cpus 和 active_groups :记录最大CPU数量和活跃组数
  • get_max_cpus() :获取最大CPU数量 本代码未使用,但认为可能会在其他模块需要这样的api
  • get_group_mask(int group) :获取指定组的CPU掩码
  • get_active_group_count() :获取活跃处理器组数量

Hansersdog avatar Jul 14 '25 13:07 Hansersdog

CLA assistant check
Thank you for your submission, we really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

:white_check_mark: Hansersdog
:x: nihui
You have signed the CLA already but the status is still pending? Let us recheck it.

tencent-adm avatar Jul 14 '25 13:07 tencent-adm

The binary size change of libncnn.so (bytes)

architecture base size pr size difference
x86_64 15124728 15124728 0 :kissing_heart:
armhf 6155744 6155744 0 :kissing_heart:
aarch64 9453192 9453192 0 :kissing_heart:

github-actions[bot] avatar Jul 14 '25 14:07 github-actions[bot]

Codecov Report

:white_check_mark: All modified and coverable lines are covered by tests. :white_check_mark: Project coverage is 95.89%. Comparing base (a514cf5) to head (3500940). :warning: Report is 2 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #6190   +/-   ##
=======================================
  Coverage   95.89%   95.89%           
=======================================
  Files         837      837           
  Lines      264994   264994           
=======================================
  Hits       254105   254105           
  Misses      10889    10889           

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

codecov-commenter avatar Jul 15 '25 02:07 codecov-commenter